summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMichael Hoang <Enzime@users.noreply.github.com>2024-03-03 13:49:27 +1100
committerGitHub <noreply@github.com>2024-03-03 13:49:27 +1100
commit17c2ca3c7537a2512224242b84e1ea3c08e79b92 (patch)
tree9d31d1c1d366af229277784e0159a66b75c439b9 /modules
parent8a15cb36fffa0b5fbe31ef16ede0a479bef4b365 (diff)
parent3397ab3b7736e345e168da0ecade5c96b8a7f042 (diff)
Merge pull request #896 from vendored/patches/support-new-nix-2.20-command-syntax
Support new nix 2.20 command syntax
Diffstat (limited to 'modules')
-rw-r--r--modules/nix/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
index ceaad55..ef5ce6c 100644
--- a/modules/nix/default.nix
+++ b/modules/nix/default.nix
@@ -62,13 +62,17 @@ let
if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then ''
echo "Ignoring validation for cross-compilation"
''
- else ''
+ else
+ let
+ showCommand = if isNixAtLeast "2.20pre" then "config show" else "show-config";
+ in
+ ''
echo "Validating generated nix.conf"
ln -s $out ./nix.conf
set -e
set +o pipefail
NIX_CONF_DIR=$PWD \
- ${cfg.package}/bin/nix show-config ${optionalString (isNixAtLeast "2.3pre") "--no-net"} \
+ ${cfg.package}/bin/nix ${showCommand} ${optionalString (isNixAtLeast "2.3pre") "--no-net"} \
${optionalString (isNixAtLeast "2.4pre") "--option experimental-features nix-command"} \
|& sed -e 's/^warning:/error:/' \
| (! grep '${if cfg.checkConfig then "^error:" else "^error: unknown setting"}')