Open nikitawootten opened 1 year ago
Have you set allowUnfreePredicate
in another module? Multiple predicates do not merge as you might expect. See https://github.com/NixOS/nixpkgs/issues/197325.
Have you set
allowUnfreePredicate
in another module? Multiple predicates do not merge as you might expect. See #197325.
Even with the solution described in that issue (creating a module that manages the allowUnfreePredicate
) I still receive the unfree error output.
lib.getName pkgs.burpsuite
results in "burpsuite"
, so that's the string to use in the predicate.
If it's still not working, then you either have multiple predicates, or the nixpkgs instance is configured in such a way to ignore the config you provided.
I ran into this issue today when I switched my home desktop from nixos-24.05 to nixos-unstable. I needed to add "aspell-dict-en-science" to the allowUnfreePredicate, so I did so in my configuration.nix. This caused my steampowered.nix's allowUnfreePredicate to break. They don't merge properly, but I know that module options do...
unfree.nix = '' / unfree.nix nixpkgs.config.allowUnfreePredicate breaks if you attempt to use it in multiple configs Guess I'll make a module that merges them? / {config, lib, pkgs, utils, ... }: { config.nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfree.allow; options.unfree = with lib; { allow = mkOption { type = types.listOf types.str; default = [ ]; example = [ "aspell-dict-en-science" "steam" ]; description = mdDoc '' Declaring "nixpkgs.config.allowUnfreePredicate" in multiple files is broken. Use "unfree.allow" instead, and this module collects them so they'll work. ''; }; }; } ''
So now in my configuration.nix I have ./unfree.nix in imports, and 'unfree.allow=["aspell-dict-en-science"];'. I can also have unfree.allow assignments in other modules I've included from configuration.nix, and they merge as expected.
Describe the bug
When attempting to add
burpsuite
to my home-manager configuration I noticed that the unfree license check was tripping even whenburpsuite
was explicitly added tonixpkgs.config.allowUnfreePredicate
. This issue happens both innixos
andhome-manager
flake modules.The unfree license check will not run even if the
nixpkgs.config.allowUnfreePredicate = (pkg: true);
workaround is used.Steps To Reproduce
Steps to reproduce the behavior:
allowUnfreePredicate
setting:Expected behavior
When
burpsuite
is added to theallowUnfreePredicate
using the method suggested by the license check, the module should evaluate without errors.Screenshots
N/A
Additional context
allowUnfreePredicate
to always return true (nixpkgs.config.allowUnfreePredicate = (pkg: true);
) does not fix the issuenixpkgs.config.allowUnfree = true;
does fix the issueNotify maintainers
@stepech @bennofs
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.