I don’t want to allow unfree packages in general but only allow a whitelist, so instead of using nixpkgs.config.allowUnfree = true
I used to fork Nixpkgs and patch the licenses in question from unfree
to free
. It’s a hack, but it works.
Now I want to replicate that behaviour with overlays. My current approach is
nixpkgs.overlays = [
(self: super: {
unifiLTS = self.lib.overrideDerivation super.unifiLTS (attrs: rec{
license = self.stdenv.lib.licenses.free;
});
}
)
];
but building the system still results in
error: Package ‘unifi-controller-5.6.39’ in /home/justin/nixpkgs/pkgs/servers/unifi/default.nix:35 has an unfree license (‘unfree’), refusing to evaluate.
a) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.
b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
What am I doing wrong?