Unfree packages on flake-based Home Manager

I am trying to set up my NixOS system with flakes and Home Manager. I wanted Home Manager to be standalone so that I can separate privileged, system-wide, config changes from user-specific ones. That being said, I put the home-manager package into my configuration.nix in order to completely avoid imperative profiles. At the moment, I have this GitHub repo: GitHub - mars-monkey/nix cloned to ~/nix.

Everything works as expected, until I add non-free packages to my HM config. I have added lines to allow unfree packages in system flake.nix, configuration.nix, and HM flake.nix, but it still doesn’t work.

On the other hand, I can install user-specific unfree packages through the users module in configuration.nix. So I think the problem has to do with the HM config and flake file. I’m still learning how to use flakes, and especially the outputs section is often difficult for me to understand.

Thanks in advance for volunteering your time for a noob like me :slightly_smiling_face:

You need to set nixpkgs.allowUnfreePredicate = _: true in your home configuration.

There is a known bug in HM open for at least one year, about the fact that nixpkgs.allowUnfree = true being broken when using HM standalone in a flake.


I copied the line from the GitHub issue you mentioned and it works! Thanks so much.