workstyle: add module

This commit is contained in:
Michael Farber Brodsky
2026-01-05 13:45:27 +02:00
committed by Austin Horstman
parent 480b0b2b81
commit 90e53291cb
9 changed files with 214 additions and 0 deletions

View 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}
'';
};
}

View File

@@ -0,0 +1,7 @@
alice = "A"
bob = "B"
[other]
deduplicate_icons = false
fallback_icon = "F"
separator = ": "

View 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;
}

View File

@@ -0,0 +1,11 @@
{
config = {
programs.workstyle = {
enable = true;
};
nmt.script = ''
assertPathNotExists home-files/.config/workstyle/config.toml
'';
};
}

View 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}
'';
};
}

View File

@@ -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

View File

@@ -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

View 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}
'';
};
}