summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/default.nix1
-rw-r--r--modules/unfree.nix19
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;
+ };
+}