mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 19:29:47 +01:00
nix: fix generation of nix.conf for nix >= 2.20
This commit is contained in:
parent
cf1b4dd2b7
commit
585ff9c3c0
1 changed files with 20 additions and 16 deletions
|
@ -52,13 +52,17 @@ 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
|
||||||
|
let
|
||||||
|
showCommand =
|
||||||
|
if isNixAtLeast "2.20pre" then "config show" else "show-config";
|
||||||
|
in ''
|
||||||
echo "Validating generated nix.conf"
|
echo "Validating generated nix.conf"
|
||||||
ln -s $out ./nix.conf
|
ln -s $out ./nix.conf
|
||||||
set -e
|
set -e
|
||||||
set +o pipefail
|
set +o pipefail
|
||||||
NIX_CONF_DIR=$PWD \
|
NIX_CONF_DIR=$PWD \
|
||||||
${cfg.package}/bin/nix show-config ${
|
${cfg.package}/bin/nix ${showCommand} ${
|
||||||
optionalString (isNixAtLeast "2.3pre")
|
optionalString (isNixAtLeast "2.3pre")
|
||||||
"--no-net --option experimental-features nix-command"
|
"--no-net --option experimental-features nix-command"
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Reference in a new issue