diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-02 18:18:07 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-02 18:18:07 +0530 |
| commit | 2e0f6163f61cb1e4195f1a08ad1148e57a4f5843 (patch) | |
| tree | c844351a0d22cb8a68d84b91630612b9c486abca /modules/desktop/darkman | |
| parent | d213c8b40f891bd83f2977f89b25ca341ee01ca4 (diff) | |
| download | home-manager-config-2e0f6163f61cb1e4195f1a08ad1148e57a4f5843.tar.gz home-manager-config-2e0f6163f61cb1e4195f1a08ad1148e57a4f5843.zip | |
feat: Added package option to each module, darkman service
- Added package options to each module which defines the
package/derivation that should be used in all other modules
- Added a systemd oneshot service that autosets darkman to dark mode
- Removed the prompt from rofi
Diffstat (limited to 'modules/desktop/darkman')
| -rw-r--r-- | modules/desktop/darkman/default.nix | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/modules/desktop/darkman/default.nix b/modules/desktop/darkman/default.nix index 4aef68d..9dc7ef9 100644 --- a/modules/desktop/darkman/default.nix +++ b/modules/desktop/darkman/default.nix @@ -7,12 +7,15 @@ }: { options.desktop.darkman = { - enable = lib.mkEnableOption "Enables darkman automatic dark/light mode switching." // { - default = true; + package = lib.mkOption { + type = lib.types.package; + readOnly = true; + default = config.services.darkman.package; + description = "The darkman package to use."; }; }; - config = lib.mkIf (config.desktop.enable && config.desktop.darkman.enable) { + config = lib.mkIf config.desktop.enable { services.darkman = { enable = true; settings = { @@ -32,8 +35,21 @@ }; # Always dark by default - home.activation.forceDarkman = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - ${pkgs.darkman}/bin/darkman set dark || true - ''; + systemd.user.services.darkman-set-theme = { + Unit = { + Description = "Set Darkman to dark on graphical session startup"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + Type = "oneshot"; + ExecStart = "${lib.getExe config.desktop.darkman.package} set dark"; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; }; } |
