Hello, I didn’t knew if to put this in “Help” or as a proposal, but, is there a way to have “allowUnfree = true;”, but have a warning of the unfree packages in the config?
Like, yes, I want to be able to install unfree packages, like Steam or Spotify, but I would also like to be told/reminded of the unfree packages in my config. Spotify or Steam are obvious cases, but there might be others that aren’t that obvious, or that maybe I forgot I had installed.
I explicitely list those I actually want and allow, and if I “accidentally” add a new unfree one, or a license changed, I will get notified by evaluation errors.
Thanks a lot, I’m quite new to nix and I couldn’t find anything that was both useful and something that I could understand. I had to resort to gpt to get something useful, but it turns out is something quite easy to do:
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.trace "UNFREE: ${pkg.pname or pkg.name}"
true;
That’s just spamming your eval. This will just cause you to overlook evaluation warnings, as you are used to “a wall of text” during evaluation.
As said, the better way was to allow unfree packages you want explicitly.
Then you can look at your configuration and see the list of allowed packages. At the same time, when you add something and it is unfree, your eval will fail, telling you what to add. If some so far free package becomes unfree, your evaluation will fail, you will know exactly when this license change occurred.
In the module below I have set up a module that defines an option nix.allowedUnfree, where I just add strings to match against package “names”.