modules/autoUnfree: allow to configure additional allowed names

main
Felix Stupp 1 year ago
parent bcc8d636e1
commit be8bb660dc
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -32,6 +32,21 @@ in
by using the option{x-banananetwork.autoUnfree.packages} option.
'';
names = lib.mkOption {
description = ''
Lists all package names which should be allowed to be installed
despite of them being unfree.
Only works when option{x-banananetwork.autoUnfree.enable} is set to true.
This option is mainly intended to be used by other module developers
to add support for this on their own.
Users may also use this additionally allow packages on their own.
'';
type = lib.types.listOf lib.types.str;
default = [ ];
};
packages = lib.mkOption {
description = ''
Lists all packages which should be allowed to be installed
@ -63,7 +78,11 @@ in
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) (map lib.getName cfg.packages);
allowUnfreePredicate =
let
names = cfg.names ++ (map lib.getName cfg.packages);
in
pkg: builtins.elem (lib.getName pkg) names;
};

Loading…
Cancel
Save