diff options
author | Simon Parri <simonparri@ganzeria.com> | 2025-06-14 17:06:54 -0500 |
---|---|---|
committer | Simon Parri <simonparri@ganzeria.com> | 2025-06-14 17:06:54 -0500 |
commit | 684ce4eac37ca022ad253fcb37bed5c17a301f33 (patch) | |
tree | 96620dee7b2024fefd3e8427e122e5f9288dbe17 /modules | |
parent | 94c63b5d30fae31b0b10f874bf5dc36d5d636275 (diff) | |
download | nixos-config-684ce4eac37ca022ad253fcb37bed5c17a301f33.tar.gz nixos-config-684ce4eac37ca022ad253fcb37bed5c17a301f33.zip |
modules/unfree: Add unfree module and use it
Diffstat (limited to 'modules')
-rw-r--r-- | modules/default.nix | 1 | ||||
-rw-r--r-- | modules/unfree.nix | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/modules/default.nix b/modules/default.nix index 034a4e3..f2c7560 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -12,6 +12,7 @@ ./syslog.nix ./hosts.nix ./bluetooth.nix + ./unfree.nix ./overlays ]; diff --git a/modules/unfree.nix b/modules/unfree.nix new file mode 100644 index 0000000..f7712f2 --- /dev/null +++ b/modules/unfree.nix @@ -0,0 +1,19 @@ +{ lib, config, ... }: + +cfg = config.this.unfree; +inherit (builtins) elem; +inherit (lib) getName; +in +{ + options = { + this.unfree.allowed = lib.mkOption { + type = with lib.types; listOf str; + default = []; + }; + }; + + config = { + nixpkgs.config.allowUnfreePredicate = + pkg: elem (getName pkg) cfg.allowed; + }; +} |