nixos/nix-daemon: Prevent network warning when checking config
Since version 2.3 (https://github.com/NixOS/nix/pull/2949 which was cherry-picked to master) Nix issues a warning when --no-net wasn't passed and there is no network interface. This commit adds the --no-net flag to the nix.conf check such that no warning is issued.
This commit is contained in:
parent
07ca91187c
commit
e463c7cd75
@ -11,6 +11,7 @@ let
|
|||||||
nixVersion = getVersion nix;
|
nixVersion = getVersion nix;
|
||||||
|
|
||||||
isNix20 = versionAtLeast nixVersion "2.0pre";
|
isNix20 = versionAtLeast nixVersion "2.0pre";
|
||||||
|
isNix23 = versionAtLeast nixVersion "2.3pre";
|
||||||
|
|
||||||
makeNixBuildUser = nr:
|
makeNixBuildUser = nr:
|
||||||
{ name = "nixbld${toString nr}";
|
{ name = "nixbld${toString nr}";
|
||||||
@ -63,7 +64,7 @@ let
|
|||||||
builders =
|
builders =
|
||||||
''}
|
''}
|
||||||
system-features = ${toString cfg.systemFeatures}
|
system-features = ${toString cfg.systemFeatures}
|
||||||
${optionalString (versionAtLeast nixVersion "2.3pre") ''
|
${optionalString isNix23 ''
|
||||||
sandbox-fallback = false
|
sandbox-fallback = false
|
||||||
''}
|
''}
|
||||||
$extraOptions
|
$extraOptions
|
||||||
@ -74,7 +75,7 @@ let
|
|||||||
'' else ''
|
'' else ''
|
||||||
echo "Checking that Nix can read nix.conf..."
|
echo "Checking that Nix can read nix.conf..."
|
||||||
ln -s $out ./nix.conf
|
ln -s $out ./nix.conf
|
||||||
NIX_CONF_DIR=$PWD ${cfg.package}/bin/nix show-config >/dev/null
|
NIX_CONF_DIR=$PWD ${cfg.package}/bin/nix show-config ${optionalString isNix23 "--no-net"} >/dev/null
|
||||||
'')
|
'')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user