Skip to content

Commit

Permalink
nixos/nix-daemon: Prevent network warning when checking config
Browse files Browse the repository at this point in the history
Since version 2.3 (NixOS/nix#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.

(cherry picked from commit e463c7c)
  • Loading branch information
infinisil committed Oct 2, 2019
1 parent 5e0b687 commit 4f0e6ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nixos/modules/services/misc/nix-daemon.nix
Expand Up @@ -11,6 +11,7 @@ let
nixVersion = getVersion nix;

isNix20 = versionAtLeast nixVersion "2.0pre";
isNix23 = versionAtLeast nixVersion "2.3pre";

makeNixBuildUser = nr:
{ name = "nixbld${toString nr}";
Expand Down Expand Up @@ -63,7 +64,7 @@ let
builders =
''}
system-features = ${toString cfg.systemFeatures}
${optionalString (versionAtLeast nixVersion "2.3pre") ''
${optionalString isNix23 ''
sandbox-fallback = false
''}
$extraOptions
Expand All @@ -74,7 +75,7 @@ let
'' else ''
echo "Checking that Nix can read 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
'')
);

Expand Down

0 comments on commit 4f0e6ee

Please sign in to comment.