summaryrefslogtreecommitdiff
path: root/modules/unfree.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/unfree.nix')
-rw-r--r--modules/unfree.nix19
1 files changed, 19 insertions, 0 deletions
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;
+ };
+}