summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr-vdp <ramses@well-founded.dev>2025-04-18 10:26:23 +0200
committerr-vdp <ramses@well-founded.dev>2025-04-18 10:38:53 +0200
commit5737bd989d6dc024a4a9b33e0bb71f7880c1e8ac (patch)
treecaa3ef527843fb97467e7cb577c84d37be38a89c
parentremnote: 1.19.11 -> 1.19.15 (#399657) (diff)
downloadnixpkgs-origin/rvdp/waybar.tar.gz
waybar: make the systemd target that pulls in waybar configurableorigin/rvdp/waybar
This is useful for instance when you only want one WM to pull in waybar, and not all of them.
-rw-r--r--nixos/modules/programs/wayland/waybar.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/programs/wayland/waybar.nix b/nixos/modules/programs/wayland/waybar.nix
index 074537ea9ed3..6e7199dbf425 100644
--- a/nixos/modules/programs/wayland/waybar.nix
+++ b/nixos/modules/programs/wayland/waybar.nix
@@ -16,13 +16,20 @@ in
// lib.mkOption {
apply = pkg: pkg.override { systemdSupport = true; };
};
+ systemd.target = lib.mkOption {
+ type = lib.types.str;
+ description = ''
+ The systemd target that will automatically start the Waybar service.
+ '';
+ default = "graphical-session.target";
+ };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd = {
packages = [ cfg.package ];
- user.services.waybar.wantedBy = [ "graphical-session.target" ];
+ user.services.waybar.wantedBy = [ cfg.systemd.target ];
};
};