1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 00:18:30 +02:00

systemd: handle Install.RequiredBy

Units with

    Install.RequiredBy = [ target ]

set will now be linked in the

    ${target}.requires

directory. Similar to how `Install.WantedBy` already causes a link in
the

    ${target}.wants

directory.
This commit is contained in:
arcnmx 2022-09-07 10:09:17 -07:00 committed by Robert Helgesson
parent 22113a3ae3
commit 2e41a1bab3
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -44,14 +44,15 @@ let
destination = "/${filename}";
} + "/${filename}";
wantedBy = target: {
name = "systemd/user/${target}.wants/${filename}";
install = variant: target: {
name = "systemd/user/${target}.${variant}/${filename}";
value = { inherit source; };
};
in lib.singleton {
name = "systemd/user/${filename}";
value = { inherit source; };
} ++ map wantedBy (serviceCfg.Install.WantedBy or [ ]);
} ++ map (install "wants") (serviceCfg.Install.WantedBy or [ ])
++ map (install "requires") (serviceCfg.Install.RequiredBy or [ ]);
buildServices = style: serviceCfgs:
lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);