nixos/nix-daemon: Prevent network warning when checking config #69868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
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.
For reference, the warning is
This is a purely cosmetic change.
Ping @edolstra @volth
Things done
nix-build nixos -A 'config.environment.etc."nix/nix.conf".source'
that no warning is issued anymorenix-build nixos -A 'config.environment.etc."nix/nix.conf".source' --arg configuration '{ pkgs, ... }: { nix.package = pkgs.nix.overrideAttrs (old: rec { name = "nix-${version}"; version = "2.2.2"; src = pkgs.fetchurl { url = "https://nixos.org/releases/nix/${name}/${name}.tar.xz"; sha256 = "f80a1b4f9837a8d33209f0b7769d5038335459ff4303eccf3e9217a9eca8594c"; }; }); }'
that an version <2.3 still works.