feat(nix): add unfree-packages module
This commit is contained in:
parent
12b7a4b7e0
commit
5a94f19922
1 changed files with 16 additions and 0 deletions
16
nix/modules/unfree-packages.nix
Normal file
16
nix/modules/unfree-packages.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (builtins) elem;
|
||||||
|
inherit (lib) mkOption 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