From 282b4c98de97da6667cb03de4f427371734bc39c Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Thu, 21 Aug 2025 07:48:42 +0200 Subject: [PATCH] blueman-applet: Add option to change systemd targets (#7702) Introduce new option for a customizable systemd targets to allow enabling the applet only in certain environments. --- modules/services/blueman-applet.nix | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/services/blueman-applet.nix b/modules/services/blueman-applet.nix index a6697805f..7c156396c 100644 --- a/modules/services/blueman-applet.nix +++ b/modules/services/blueman-applet.nix @@ -24,6 +24,19 @@ in }; package = lib.mkPackageOption pkgs "blueman" { }; + + systemdTargets = lib.mkOption { + type = with lib.types; listOf str; + default = [ "graphical-session.target" ]; + example = [ "sway-session.target" ]; + description = '' + The systemd targets that will automatically start the cliphist service. + + When setting this value to `["sway-session.target"]`, + make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`, + otherwise the service may never be started. + ''; + }; }; }; @@ -36,15 +49,12 @@ in Unit = { Description = "Blueman applet"; Requires = [ "tray.target" ]; - After = [ - "graphical-session.target" - "tray.target" - ]; - PartOf = [ "graphical-session.target" ]; + After = cfg.systemdTargets ++ [ "tray.target" ]; + PartOf = cfg.systemdTargets; }; Install = { - WantedBy = [ "graphical-session.target" ]; + WantedBy = cfg.systemdTargets; }; Service = {