mirror of
https://github.com/nix-community/home-manager
synced 2024-12-23 18:29:47 +01:00
waybar: configurable systemd WantedBy target (#2524)
Before this commit, a user needed to override the systemd target that would start Waybar with `mkForce`, this is no longer necessary.
This commit is contained in:
parent
3b9c625b64
commit
f15b151ca1
3 changed files with 17 additions and 2 deletions
|
@ -197,6 +197,20 @@ in {
|
|||
|
||||
systemd.enable = mkEnableOption "Waybar systemd integration";
|
||||
|
||||
systemd.target = mkOption {
|
||||
type = str;
|
||||
default = "graphical-session.target";
|
||||
example = "sway-session.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the Waybar service.
|
||||
</para>
|
||||
<para>
|
||||
When setting this value to <literal>"sway-session.target"</literal>,
|
||||
make sure to also enable <option>wayland.windowManager.sway.systemdIntegration</option>,
|
||||
otherwise the service may never be started.
|
||||
'';
|
||||
};
|
||||
|
||||
style = mkOption {
|
||||
type = nullOr (either path str);
|
||||
default = null;
|
||||
|
@ -309,7 +323,7 @@ in {
|
|||
KillMode = "mixed";
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
Install = { WantedBy = [ cfg.systemd.target ]; };
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
|
@ -10,6 +10,7 @@ with lib;
|
|||
package = config.lib.test.mkStubPackage { outPath = "@waybar@"; };
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
systemd.target = "sway-session.target";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
WantedBy=sway-session.target
|
||||
|
||||
[Service]
|
||||
ExecReload=kill -SIGUSR2 $MAINPID
|
||||
|
|
Loading…
Reference in a new issue