From fb9c6d4950ade1007a9a03bf09b31b7dc222a224 Mon Sep 17 00:00:00 2001 From: Davi Ribeiro <104164579+Markus328@users.noreply.github.com> Date: Wed, 3 Sep 2025 09:03:01 -0300 Subject: nix/hm: move environment to systemd.environment + refactor (#551) * nix/hm: environment moved to systemd.environment * nix/hm: change systemd default target Follow the home-manager convention for wayland systemd services * nix/hm: refactor * readme: refactor configuring section * readme: fix format * format --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- nix/hm-module.nix | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'nix/hm-module.nix') 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"; }; -- cgit v1.2.3-freya