mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
workstyle: add module
This commit is contained in:
committed by
Austin Horstman
parent
480b0b2b81
commit
90e53291cb
21
tests/modules/programs/workstyle/basic-configuration.nix
Normal file
21
tests/modules/programs/workstyle/basic-configuration.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
config = {
|
||||
programs.workstyle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
alice = "A";
|
||||
bob = "B";
|
||||
other = {
|
||||
fallback_icon = "F";
|
||||
deduplicate_icons = false;
|
||||
separator = ": ";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/workstyle/config.toml
|
||||
assertFileContent home-files/.config/workstyle/config.toml ${./basic-configuration.toml}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
alice = "A"
|
||||
bob = "B"
|
||||
|
||||
[other]
|
||||
deduplicate_icons = false
|
||||
fallback_icon = "F"
|
||||
separator = ": "
|
||||
8
tests/modules/programs/workstyle/default.nix
Normal file
8
tests/modules/programs/workstyle/default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
workstyle-basic-configuration = ./basic-configuration.nix;
|
||||
workstyle-empty-configuration = ./empty-configuration.nix;
|
||||
workstyle-systemd-user-service = ./systemd-user-service.nix;
|
||||
workstyle-full-configuration = ./full-configuration.nix;
|
||||
}
|
||||
11
tests/modules/programs/workstyle/empty-configuration.nix
Normal file
11
tests/modules/programs/workstyle/empty-configuration.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
config = {
|
||||
programs.workstyle = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/workstyle/config.toml
|
||||
'';
|
||||
};
|
||||
}
|
||||
30
tests/modules/programs/workstyle/full-configuration.nix
Normal file
30
tests/modules/programs/workstyle/full-configuration.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
config = {
|
||||
programs.workstyle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
alice = "A";
|
||||
bob = "B";
|
||||
other = {
|
||||
fallback_icon = "F";
|
||||
deduplicate_icons = false;
|
||||
separator = ": ";
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
# Make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`
|
||||
enable = true;
|
||||
target = "sway-session.target";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/workstyle/config.toml
|
||||
assertFileContent home-files/.config/workstyle/config.toml ${./basic-configuration.toml}
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/workstyle.service \
|
||||
${./systemd-user-service-expected-sway.service}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Install]
|
||||
WantedBy=a.target
|
||||
|
||||
[Service]
|
||||
Environment=RUST_LOG=debug
|
||||
ExecStart=@workstyle@/bin/workstyle
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Unit]
|
||||
BindsTo=a.target
|
||||
Description=workstyle autostart
|
||||
@@ -0,0 +1,11 @@
|
||||
[Install]
|
||||
WantedBy=sway-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@workstyle@/bin/workstyle
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Unit]
|
||||
BindsTo=sway-session.target
|
||||
Description=workstyle autostart
|
||||
20
tests/modules/programs/workstyle/systemd-user-service.nix
Normal file
20
tests/modules/programs/workstyle/systemd-user-service.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
config = {
|
||||
programs.workstyle = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
debug = true;
|
||||
target = "a.target";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/workstyle/config.toml
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/workstyle.service \
|
||||
${./systemd-user-service-expected-debug.service}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user