mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
waybar: systemd cleanup
No reason to allow nullable and it was inconsistently applied
This commit is contained in:
@@ -221,7 +221,7 @@ in
|
||||
systemd.enable = mkEnableOption "Waybar systemd integration";
|
||||
|
||||
systemd.target = mkOption {
|
||||
type = nullOr str;
|
||||
type = str;
|
||||
default = config.wayland.systemd.target;
|
||||
defaultText = literalExpression "config.wayland.systemd.target";
|
||||
example = "sway-session.target";
|
||||
@@ -354,20 +354,18 @@ in
|
||||
++ optional (cfg.style != null) "${config.xdg.configFile."waybar/style.css".source}";
|
||||
};
|
||||
|
||||
Service =
|
||||
{
|
||||
ExecStart = "${cfg.package}/bin/waybar";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID";
|
||||
Restart = "on-failure";
|
||||
KillMode = "mixed";
|
||||
}
|
||||
// optionalAttrs cfg.systemd.enableInspect {
|
||||
Environment = [ "GTK_DEBUG=interactive" ];
|
||||
};
|
||||
Service = {
|
||||
Environment = optional cfg.systemd.enableInspect "GTK_DEBUG=interactive";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID";
|
||||
ExecStart = "${cfg.package}/bin/waybar";
|
||||
KillMode = "mixed";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
||||
Install.WantedBy = [
|
||||
cfg.systemd.target
|
||||
"tray.target"
|
||||
] ++ lib.optional (cfg.systemd.target != null) cfg.systemd.target;
|
||||
];
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Install]
|
||||
WantedBy=tray.target
|
||||
WantedBy=sway-session.target
|
||||
WantedBy=tray.target
|
||||
|
||||
[Service]
|
||||
ExecReload=/nix/store/00000000000000000000000000000000-coreutils/bin/kill -SIGUSR2 $MAINPID
|
||||
|
||||
Reference in New Issue
Block a user