mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
nix: fix generation of nix.conf for nix >= 2.20
This commit is contained in:
parent
4d53427bce
commit
880d9bc211
1 changed files with 20 additions and 16 deletions
|
@ -52,22 +52,26 @@ let
|
||||||
checkPhase =
|
checkPhase =
|
||||||
if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then ''
|
if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then ''
|
||||||
echo "Ignoring validation for cross-compilation"
|
echo "Ignoring validation for cross-compilation"
|
||||||
'' else ''
|
'' else
|
||||||
echo "Validating generated nix.conf"
|
let
|
||||||
ln -s $out ./nix.conf
|
showCommand =
|
||||||
set -e
|
if isNixAtLeast "2.20pre" then "config show" else "show-config";
|
||||||
set +o pipefail
|
in ''
|
||||||
NIX_CONF_DIR=$PWD \
|
echo "Validating generated nix.conf"
|
||||||
${cfg.package}/bin/nix show-config ${
|
ln -s $out ./nix.conf
|
||||||
optionalString (isNixAtLeast "2.3pre")
|
set -e
|
||||||
"--no-net --option experimental-features nix-command"
|
set +o pipefail
|
||||||
} \
|
NIX_CONF_DIR=$PWD \
|
||||||
|& sed -e 's/^warning:/error:/' \
|
${cfg.package}/bin/nix ${showCommand} ${
|
||||||
| (! grep '${
|
optionalString (isNixAtLeast "2.3pre")
|
||||||
if cfg.checkConfig then "^error:" else "^error: unknown setting"
|
"--no-net --option experimental-features nix-command"
|
||||||
}')
|
} \
|
||||||
set -o pipefail
|
|& sed -e 's/^warning:/error:/' \
|
||||||
'';
|
| (! grep '${
|
||||||
|
if cfg.checkConfig then "^error:" else "^error: unknown setting"
|
||||||
|
}')
|
||||||
|
set -o pipefail
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
semanticConfType = with types;
|
semanticConfType = with types;
|
||||||
|
|
Loading…
Reference in a new issue