mirror of
https://github.com/nix-community/home-manager
synced 2024-11-05 02:39:45 +01: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:
parent
22113a3ae3
commit
2e41a1bab3
1 changed files with 4 additions and 3 deletions
|
@ -44,14 +44,15 @@ let
|
||||||
destination = "/${filename}";
|
destination = "/${filename}";
|
||||||
} + "/${filename}";
|
} + "/${filename}";
|
||||||
|
|
||||||
wantedBy = target: {
|
install = variant: target: {
|
||||||
name = "systemd/user/${target}.wants/${filename}";
|
name = "systemd/user/${target}.${variant}/${filename}";
|
||||||
value = { inherit source; };
|
value = { inherit source; };
|
||||||
};
|
};
|
||||||
in lib.singleton {
|
in lib.singleton {
|
||||||
name = "systemd/user/${filename}";
|
name = "systemd/user/${filename}";
|
||||||
value = { inherit source; };
|
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:
|
buildServices = style: serviceCfgs:
|
||||||
lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);
|
lib.concatLists (lib.mapAttrsToList (buildService style) serviceCfgs);
|
||||||
|
|
Loading…
Reference in a new issue