Home-manager: nixpkgs.config and nixpkgs.overlays do not seem to work

Created on 9 Mar 2018  路  6Comments  路  Source: nix-community/home-manager

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.

Most helpful comment

@taohansen Sorry for the delay. It should be possible with something like nixpkgs.config.allowUnfree = true; in your home.nix.

All 6 comments

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 your home.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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mightybyte picture mightybyte  路  5Comments

akavel picture akavel  路  8Comments

wedens picture wedens  路  6Comments

Dav1d23 picture Dav1d23  路  5Comments

pmiddend picture pmiddend  路  3Comments