summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-05-11 23:19:03 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-05-11 23:19:03 +0200
commit8cb11d968f3a0a094602225973a4f4c38bc0e4a8 (patch)
tree2665452fb12deb6633968ac6680debaa9fc3c756 /modules/system
parenta2843f81922b297a5d10bf735311a0f778f9ca39 (diff)
launchd: remove double slashes in paths that use $HOME
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/launchd.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/system/launchd.nix b/modules/system/launchd.nix
index 2d79fc6..e8b9ecd 100644
--- a/modules/system/launchd.nix
+++ b/modules/system/launchd.nix
@@ -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