Setting the nixpkgs.config and nixpkgs.overlays options in my home-manager configuration does not seem to do anything. This can probably most easily be replicated by setting:
nixpkgs.config = { allowUnfree = true; }
and trying to install a nonfree package via nix-env.
I am using the NixOS module to set my configuration.
That's intended behaviour, these setting only apply to the pkgs set in the module evaluation. This is the same behaviour for nixos' nixpkgs.* options.
I guess this could be made clearer in the options description.
Yeah, this is by design. In my configuration I have
nixpkgs.config = import dotfiles/nixpkgs-config.nix;
xdg.configFile."nixpkgs/config.nix".source = dotfiles/nixpkgs-config.nix;
to have the same configuration in both places.
I'll close this issue now but I opened #230 to improve the option descriptions a bit. Please have a look and comment on the phrasing (which I didn't spend much time on).
How does one allow nonfree packages in the scope of their home.nx?
@taohansen Sorry for the delay. It should be possible with something like nixpkgs.config.allowUnfree = true; in your home.nix.
@taohansen Sorry for the delay. It should be possible with something like
nixpkgs.config.allowUnfree = true;in yourhome.nix.
I just tried replacing the file in ~/.config/nixpkgs/config.nix with the above in home.nix, but when switching HM complained about a non-free package - so it seems this is not working.
Most helpful comment
@taohansen Sorry for the delay. It should be possible with something like
nixpkgs.config.allowUnfree = true;in yourhome.nix.