zhaofengli / colmena

A simple, stateless NixOS deployment tool
https://colmena.cli.rs
MIT License
1.13k stars 64 forks source link

nixpkgs.config.allowUnfree unrecognized #15

Open tv42 opened 3 years ago

tv42 commented 3 years ago

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.

zhaofengli commented 3 years ago

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.