refactor(nix): move unfree packages module to options
This commit is contained in:
parent
8c2b1dfc6e
commit
9403daff02
1 changed files with 2 additions and 1 deletions
17
nix/modules/options/unfree-packages.nix
Normal file
17
nix/modules/options/unfree-packages.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (builtins) elem;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.strings) getName;
|
||||
inherit (lib.types) listOf str;
|
||||
predicate = pkg: elem (getName pkg) config.allowedUnfreePackages;
|
||||
in
|
||||
{
|
||||
options.allowedUnfreePackages = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
config.flake.modules.nixos.default = {
|
||||
nixpkgs.config.allowUnfreePredicate = predicate;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue