From dc33fe3d896db66de6314de3fef653fb80d4aa24 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 21 Jan 2018 13:46:30 +0100 Subject: 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. --- modules/system/etc.nix | 14 ++++++++------ modules/system/launchd.nix | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'modules/system') 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 -- cgit v1.2.3