diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index dbbe89c3d..2239fe5ef 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -198,7 +198,7 @@ in { systemd.enable = mkEnableOption "Waybar systemd integration"; systemd.target = mkOption { - type = str; + type = nullOr str; default = config.wayland.systemd.target; defaultText = literalExpression "config.wayland.systemd.target"; example = "sway-session.target"; @@ -326,7 +326,8 @@ in { KillMode = "mixed"; }; - Install = { WantedBy = [ cfg.systemd.target ]; }; + Install.WantedBy = + lib.optional (cfg.systemd.target != null) cfg.systemd.target; }; }) ]);