colmena icon indicating copy to clipboard operation
colmena copied to clipboard

nixpkgs.config.allowUnfree unrecognized

Open tv42 opened this issue 3 years ago • 1 comments

I have a host that uses the nonfree broadcom-sta wifi driver. I don't actually use the wifi, but nixos-install slapped that in the hardware-config.nix, so my /etc/nixos/configuration.nix says nixpkgs.config.allowUnfree = true;.

I copied the /etc/nixos contents to my colmena client host in directory host/foo/ and wrote a hive.nix like this:

{
  foo = import ./host/foo/configuration.nix;
}

and everything works, but colmena warns:

foo | trace: warning: The following Nixpkgs configuration keys set in meta.nixpkgs will be ignored: allowUnfreePredicate

It still understands the nixpkgs.config line, because if I comment out the allowUnfree=true, the build fails in the usual "refusing to evaluate" way. The colmena warning seems like a false positive.

tv42 avatar Mar 10 '21 04:03 tv42

Good catch! The warning is there since if nixpkgs.config is set at all in the node configurations, it will replace (not merged to) the config set if you pass an initialized Nixpkgs attribute set to meta.nixpkgs. To reduce confusion (well, it seems to have increased confusion in this case), Colmena will emit the warning if not all config keys set in meta.nixpkgs are overridden. I'll figure out a more robust way to handle this.

zhaofengli avatar Mar 10 '21 16:03 zhaofengli