From 0e3a6203747b6c3c24dec34cb3df5b829bf47100 Mon Sep 17 00:00:00 2001 From: Lisanna Dettwyler Date: Mon, 26 Jan 2026 12:13:20 -0500 Subject: [PATCH] Fix build-hook setting being clobbered settings.buildHook.setDefault was running after nix.conf was parsed, causing whatever value settings.buildHook had to be clobbered. Re-arrange the logic so that the default is set before nix.conf is parsed, so that custom build hooks can be used by specifying them in nix.conf. Signed-off-by: Lisanna Dettwyler --- src/nix/main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nix/main.cc b/src/nix/main.cc index 811d1c495a6..cbee5cde8af 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -374,10 +374,6 @@ void mainWrapped(int argc, char ** argv) } #endif - initNix(); - initGC(); - flakeSettings.configureEvalSettings(evalSettings); - /* Set the build hook location For builds we perform a self-invocation, so Nix has to be @@ -390,6 +386,10 @@ void mainWrapped(int argc, char ** argv) "__build-remote", }); + initNix(); + initGC(); + flakeSettings.configureEvalSettings(evalSettings); + #ifdef __linux__ if (isRootUser()) { try {