mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
launchd: fix multiple agents
This commit is contained in:
parent
2499b91692
commit
ea85f4b1fd
1 changed files with 11 additions and 11 deletions
|
@ -42,19 +42,19 @@ let
|
||||||
mapAttrs' (n: v: nameValuePair "${v.config.Label}.plist" (toAgent v.config))
|
mapAttrs' (n: v: nameValuePair "${v.config.Label}.plist" (toAgent v.config))
|
||||||
(filterAttrs (n: v: v.enable) cfg.agents);
|
(filterAttrs (n: v: v.enable) cfg.agents);
|
||||||
|
|
||||||
agentsDrv = pkgs.runCommand "home-manager-agents" {
|
agentsDrv = pkgs.runCommand "home-manager-agents" { } ''
|
||||||
srcs = attrValues agentPlists;
|
|
||||||
dsts = attrNames agentPlists;
|
|
||||||
} ''
|
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
|
|
||||||
if [[ -n "$srcs" ]]; then
|
declare -A plists
|
||||||
for (( i=0; i < "''${#srcs[@]}"; i+=1 )); do
|
plists=(${
|
||||||
src="''${srcs[i]}"
|
concatStringsSep " "
|
||||||
dst="''${dsts[i]}"
|
(mapAttrsToList (name: value: "['${name}']='${value}'") agentPlists)
|
||||||
ln -s "$src" "$out/$dst"
|
})
|
||||||
|
|
||||||
|
for dest in "''${!plists[@]}"; do
|
||||||
|
src="''${plists[$dest]}"
|
||||||
|
ln -s "$src" "$out/$dest"
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
meta.maintainers = with maintainers; [ midchildan ];
|
meta.maintainers = with maintainers; [ midchildan ];
|
||||||
|
|
Loading…
Reference in a new issue