From 8b4fc00d8e54856e9b6a981951aa01a311569c79 Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Sat, 11 May 2024 21:32:48 +1000 Subject: [PATCH] Use runCommandLocal --- default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index 77989d6..28c83eb 100644 --- a/default.nix +++ b/default.nix @@ -45,6 +45,7 @@ emacsPackagesFor, lib, runCommand, + runCommandLocal, runtimeShell, writeText, makeBinaryWrapper, @@ -63,9 +64,8 @@ let # Uses Doom's CLI framework, which does not require anything else is installed # (not even straight). - # XXX this may need to be runCommandLocal just in case conditionals an init.el - # / packages.el evaluate differently on build systems. - doomIntermediates = runCommand "doom-intermediates" + # Force local build in case the user init.el does something weird and to avoid a roundtrip. + doomIntermediates = runCommandLocal "doom-intermediates" { env = { EMACS = lib.getExe emacs; @@ -195,7 +195,8 @@ let } // optionalAttrs (p ? recipe.branch) { ref = p.recipe.branch; } // optionalAttrs (p ? recipe.depth) { shallow = p.recipe.depth == 1; } ); - reqfile = runCommand "${name}-deps" { } '' + # Run locally to avoid a network roundtrip. + reqfile = runCommandLocal "${name}-deps" { } '' ${lib.getExe emacs} -Q --batch --script \ ${./build-helpers/print-deps.el} ${src} > $out ''; @@ -227,8 +228,8 @@ let # - The path to the generated profile is included in the loader # - Generating the profile depends on the loader - # XXX runCommandLocal? (See doomIntermediates.) - doomProfile = runCommand "doom-profile" + # Force local build in case the user init.el does something weird. + doomProfile = runCommandLocal "doom-profile" { env = { EMACS = lib.getExe emacsWithPackages; @@ -279,6 +280,8 @@ let ''; # Step 6: write wrappers to start the whole thing. + + # Use runCommand, not runCommandLocal, because makeBinaryWrapper pulls in a compiler. doomEmacs = runCommand "doom-emacs" { nativeBuildInputs = [ makeBinaryWrapper ]; } ''