From 16f82f0b52bf9252ae64ec4cdb152e4e743045df Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Wed, 9 Oct 2024 08:02:46 +0900 Subject: [PATCH] Fix python build failures for the -env. Querying the .drvPath causes nix to try and build arp-util, python3.11-setuptools, setuptools-build-hook, scons, serf, llvm, clang, libredirect, subversion, and openssh. --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 5cd7149..4fac0db 100644 --- a/flake.nix +++ b/flake.nix @@ -187,12 +187,15 @@ } "touch $out"; } // (pkgs.lib.mapAttrs' (name: drv: pkgs.lib.nameValuePair "${name}-env" ( + # We need to use unsafeDiscardOutputDependency here, as it will otherwise + # pull in a bunch of dependenceis we don't care about at all from the .drvPath + # query. let env = pkgs.runCommand "${name}-env.sh" { requiredSystemFeatures = [ "recursive-nix" ]; nativeBuildInputs = [ pkgs.nix ]; } '' nix --offline --extra-experimental-features "nix-command flakes" \ - print-dev-env ${drv.drvPath} >> $out + print-dev-env ${builtins.unsafeDiscardOutputDependency drv.drvPath} >> $out ''; # this needs to be linux. It would be great if we could have this # eval platform agnostic, but flakes don't permit this. A the