From 25625d78e4ecde0d12bb5f458d7a055475429c8d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 3 Aug 2024 14:10:03 +0200 Subject: [PATCH] nixos/ayatana-indicators: Add systemd target for Lomiri Lomiri now uses a separate systemd user target for all indicators that should start under Lomiri, because some Ayatana-like indicators do not make sense on non-Lomiri desktops. Probably temporary, as we should instead encode this data from every indicator's service file into some passthru attribute. --- .../services/desktops/ayatana-indicators.nix | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/desktops/ayatana-indicators.nix b/nixos/modules/services/desktops/ayatana-indicators.nix index 613a2f03ea05..0761d1107cc9 100644 --- a/nixos/modules/services/desktops/ayatana-indicators.nix +++ b/nixos/modules/services/desktops/ayatana-indicators.nix @@ -38,20 +38,23 @@ in }; # libayatana-common's ayatana-indicators.target with explicit Wants & Before to bring up requested indicator services - systemd.user.targets."ayatana-indicators" = + systemd.user.targets = let - indicatorServices = lib.lists.flatten - (map - (pkg: - (map (ind: "${ind}.service") pkg.passthru.ayatana-indicators)) - cfg.packages); + indicatorServices = lib.lists.flatten ( + map (pkg: (map (ind: "${ind}.service") pkg.passthru.ayatana-indicators)) cfg.packages + ); in - { - description = "Target representing the lifecycle of the Ayatana Indicators. Each indicator should be bound to it in its individual service file"; - partOf = [ "graphical-session.target" ]; - wants = indicatorServices; - before = indicatorServices; - }; + lib.attrsets.mapAttrs + (_: desc: { + description = "Target representing the lifecycle of the ${desc}. Each indicator should be bound to it in its individual service file"; + partOf = [ "graphical-session.target" ]; + wants = indicatorServices; + before = indicatorServices; + }) + { + ayatana-indicators = "Ayatana Indicators"; + lomiri-indicators = "Ayatana/Lomiri Indicators that shall be run in Lomiri"; + }; }; meta.maintainers = with lib.maintainers; [ OPNA2608 ];