File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,13 +109,17 @@ let
109109 if pkgs . stdenv . hostPlatform != pkgs . stdenv . buildPlatform then ''
110110 echo "Ignoring validation for cross-compilation"
111111 ''
112- else ''
112+ else
113+ let
114+ showCommand = if isNixAtLeast "2.20pre" then "config show" else "show-config" ;
115+ in
116+ ''
113117 echo "Validating generated nix.conf"
114118 ln -s $out ./nix.conf
115119 set -e
116120 set +o pipefail
117121 NIX_CONF_DIR=$PWD \
118- ${ cfg . package } /bin/nix show-config ${ optionalString ( isNixAtLeast "2.3pre" ) "--no-net" } \
122+ ${ cfg . package } /bin/nix ${ showCommand } ${ optionalString ( isNixAtLeast "2.3pre" ) "--no-net" } \
119123 ${ optionalString ( isNixAtLeast "2.4pre" ) "--option experimental-features nix-command" } \
120124 |& sed -e 's/^warning:/error:/' \
121125 | (! grep '${ if cfg . checkAllErrors then "^error:" else "^error: unknown setting" } ')
You can’t perform that action at this time.
0 commit comments