diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-01-21 13:46:30 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-01-21 13:46:30 +0100 |
| commit | dc33fe3d896db66de6314de3fef653fb80d4aa24 (patch) | |
| tree | 001091d74e7911e3c06c0a7377a1b7b6f2da14f4 /modules/system | |
| parent | b761ee79a37f596b517a7ba243a95dd90c860b51 (diff) | |
system: use preferLocalBuild for simple derivations
Most of the builds like system.build.etc will be faster when built
locally, they also don't depend on CC.
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/etc.nix | 14 | ||||
| -rw-r--r-- | modules/system/launchd.nix | 20 |
2 files changed, 19 insertions, 15 deletions
diff --git a/modules/system/etc.nix b/modules/system/etc.nix index b3d803a..6577aec 100644 --- a/modules/system/etc.nix +++ b/modules/system/etc.nix @@ -31,12 +31,14 @@ in config = { - system.build.etc = pkgs.runCommand "etc" {} '' - mkdir -p $out/etc - cd $out/etc - ${concatMapStringsSep "\n" (attr: "mkdir -p $(dirname '${attr.target}')") etc} - ${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") etc} - ''; + system.build.etc = pkgs.runCommandNoCC "etc" + { preferLocalBuild = true; } + '' + mkdir -p $out/etc + cd $out/etc + ${concatMapStringsSep "\n" (attr: "mkdir -p $(dirname '${attr.target}')") etc} + ${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") etc} + ''; system.activationScripts.etc.text = '' # Set up the statically computed bits of /etc. diff --git a/modules/system/launchd.nix b/modules/system/launchd.nix index 5e5b262..dce0523 100644 --- a/modules/system/launchd.nix +++ b/modules/system/launchd.nix @@ -84,15 +84,17 @@ in config = { - system.build.launchd = pkgs.runCommand "launchd" {} '' - mkdir -p $out/Library/LaunchAgents $out/Library/LaunchDaemons $out/user/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/user/Library/LaunchAgents - ${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") userLaunchAgents} - ''; + system.build.launchd = pkgs.runCommandNoCC "launchd" + { preferLocalBuild = true; } + '' + mkdir -p $out/Library/LaunchAgents $out/Library/LaunchDaemons $out/user/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/user/Library/LaunchAgents + ${concatMapStringsSep "\n" (attr: "ln -s '${attr.source}' '${attr.target}'") userLaunchAgents} + ''; system.activationScripts.launchd.text = '' # Set up launchd services in /Library/LaunchAgents and /Library/LaunchDaemons |
