mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 18:57:08 +00:00
launchd: remove double slashes in paths that use $HOME
This commit is contained in:
parent
a2843f8192
commit
8cb11d968f
1 changed files with 6 additions and 6 deletions
|
@ -24,11 +24,11 @@ let
|
|||
'';
|
||||
|
||||
userLaunchdActivation = target: ''
|
||||
if ! diff '${cfg.build.launchd}/${home}/Library/LaunchAgents/${target}' '${home}/Library/LaunchAgents/${target}'; then
|
||||
if ! diff '${cfg.build.launchd}${home}/Library/LaunchAgents/${target}' '${home}/Library/LaunchAgents/${target}'; then
|
||||
if test -f '${home}/Library/LaunchAgents/${target}'; then
|
||||
launchctl unload -w '${home}/Library/LaunchAgents/${target}' || true
|
||||
fi
|
||||
cp -f '${cfg.build.launchd}/${home}/Library/LaunchAgents/${target}' '${home}/Library/LaunchAgents/${target}'
|
||||
cp -f '${cfg.build.launchd}${home}/Library/LaunchAgents/${target}' '${home}/Library/LaunchAgents/${target}'
|
||||
launchctl load '${home}/Library/LaunchAgents/${target}'
|
||||
fi
|
||||
'';
|
||||
|
@ -71,12 +71,12 @@ in
|
|||
config = {
|
||||
|
||||
system.build.launchd = pkgs.runCommand "launchd" {} ''
|
||||
mkdir -p $out/Library/LaunchAgents $out/Library/LaunchDaemons $out/${home}/Library/LaunchAgents
|
||||
mkdir -p $out/Library/LaunchAgents $out/Library/LaunchDaemons $out${home}/Library/LaunchAgents
|
||||
cd $out/Library/LaunchAgents
|
||||
${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") launchAgents}
|
||||
cd $out/Library/LaunchDaemons
|
||||
${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") launchDaemons}
|
||||
cd $out/${home}/Library/LaunchAgents
|
||||
cd $out${home}/Library/LaunchAgents
|
||||
${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") userLaunchAgents}
|
||||
'';
|
||||
|
||||
|
@ -108,8 +108,8 @@ in
|
|||
|
||||
${concatMapStringsSep "\n" (attr: userLaunchdActivation attr.target) userLaunchAgents}
|
||||
|
||||
for f in $(ls /run/current-system/${home}/Library/LaunchAgents); do
|
||||
if test ! -e "${cfg.build.launchd}/${home}/Library/LaunchAgents/$f"; then
|
||||
for f in $(ls /run/current-system${home}/Library/LaunchAgents); do
|
||||
if test ! -e "${cfg.build.launchd}${home}/Library/LaunchAgents/$f"; then
|
||||
launchctl unload -w "${home}/Library/LaunchAgents/$f" || true
|
||||
if test -e "${home}/Library/LaunchAgents/$f"; then rm -f "${home}/Library/LaunchAgents/$f"; fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue