diff --git a/flake.nix b/flake.nix index dbf5eb7d8..867f0c9c7 100644 --- a/flake.nix +++ b/flake.nix @@ -418,15 +418,9 @@ # Make sure that nix-env still produces the exact same result # on a particular version of Nixpkgs. - evalNixpkgs = - with nixpkgsFor.x86_64-linux.native; - runCommand "eval-nixos" { buildInputs = [ nix ]; } '' - type -p nix-env - # Note: we're filtering out nixos-install-tools because https://github.com/NixOS/nixpkgs/pull/153594#issuecomment-1020530593. - time nix-env --store dummy:// -f ${nixpkgs-regression} -qaP --drv-path | sort | grep -v nixos-install-tools > packages - [[ $(sha1sum < packages | cut -c1-40) = 402242fca90874112b34718b8199d844e8b03d12 ]] - mkdir $out - ''; + evalNixpkgs = nixpkgsFor.x86_64-linux.native.callPackage ./tests/nixpkgs/eval.nix { + inherit nixpkgs-regression; + }; nixpkgsLibTests = forAllSystems ( system: diff --git a/tests/nixpkgs/eval.nix b/tests/nixpkgs/eval.nix new file mode 100644 index 000000000..c00aeb44a --- /dev/null +++ b/tests/nixpkgs/eval.nix @@ -0,0 +1,26 @@ +{ + lib, + runCommand, + nix, + + nixpkgs-regression, +}: + +let + inherit (lib) concatStringsSep; + + deprecatedFeatures = [ ]; +in + +runCommand "eval-nixos" + { + buildInputs = [ nix ]; + env.NIX_CONFIG = "extra-deprecated-features = ${concatStringsSep " " deprecatedFeatures}"; + } + '' + type -p nix-env + # Note: we're filtering out nixos-install-tools because https://github.com/NixOS/nixpkgs/pull/153594#issuecomment-1020530593. + time nix-env --store dummy:// -f ${nixpkgs-regression} -qaP --drv-path | sort | grep -v nixos-install-tools > packages + [[ $(sha1sum < packages | cut -c1-40) = 402242fca90874112b34718b8199d844e8b03d12 ]] + mkdir $out + ''