extract unfree option to it's own module

This commit is contained in:
Gerg-L 2025-01-29 19:37:48 -05:00
parent 03b359ee5a
commit 3aef3e349f
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
2 changed files with 74 additions and 73 deletions

View file

@ -5,18 +5,8 @@
nix-janitor,
}:
{
options.local.allowedUnfree = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
config = {
nixpkgs.config = {
allowAliases = false;
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
};
nixpkgs.config.allowAliases = false;
local.packages = {
inherit (pkgs)
bottom # view tasks
@ -82,5 +72,4 @@
programs.command-not-found.enable = false;
system.rebuild.enableNg = true;
};
}

12
nixosModules/unfree.nix Normal file
View file

@ -0,0 +1,12 @@
{ lib, config }:
{
options.local.allowedUnfree = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
config = {
nixpkgs.config.allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
};
}