diff options
Diffstat (limited to 'nix/hm-module.nix')
| -rw-r--r-- | nix/hm-module.nix | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 7eb6efa..92f2f51 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -11,6 +11,9 @@ self: { cfg = config.programs.caelestia; in { + imports = [ + (lib.mkRenamedOptionModule ["programs" "caelestia" "environment"] ["programs" "caelestia" "systemd" "environment"]) + ]; options = with lib; { programs.caelestia = { enable = mkEnableOption "Enable Caelestia shell"; @@ -30,7 +33,15 @@ in { description = '' The systemd target that will automatically start the Caelestia shell. ''; - default = "graphical-session.target"; + default = config.wayland.systemd.target; + }; + environment = mkOption { + type = types.listOf types.str; + description = "Extra Environment variables to pass to the Caelestia shell systemd service."; + default = []; + example = [ + "QT_QPA_PLATFORMTHEME=gtk3" + ]; }; }; settings = mkOption { @@ -43,14 +54,6 @@ in { default = ""; description = "Caelestia shell extra configs written to shell.json"; }; - environment = mkOption { - type = types.listOf types.str; - description = "Extra Environment variables to pass to the Caelestia shell systemd service."; - default = [ ]; - example = [ - "QT_QPA_PLATFORMTHEME=gtk3" - ]; - }; cli = { enable = mkEnableOption "Enable Caelestia CLI"; package = mkOption { @@ -73,8 +76,8 @@ in { }; config = let - cli = cfg.cli.package or cli-default; - shell = cfg.package or shell-default; + cli = cfg.cli.package; + shell = cfg.package; in lib.mkIf cfg.enable { systemd.user.services.caelestia = lib.mkIf cfg.systemd.enable { @@ -93,10 +96,11 @@ in { Restart = "on-failure"; RestartSec = "5s"; TimeoutStopSec = "5s"; - Environment = [ - "QT_QPA_PLATFORM=wayland" - ] - ++ cfg.environment; + Environment = + [ + "QT_QPA_PLATFORM=wayland" + ] + ++ cfg.systemd.environment; Slice = "session.slice"; }; |