diff options
-rw-r--r-- | hosts/tomato/hardware.nix | 1 | ||||
-rw-r--r-- | modules/default.nix | 1 | ||||
-rw-r--r-- | modules/unfree.nix | 19 |
3 files changed, 21 insertions, 0 deletions
diff --git a/hosts/tomato/hardware.nix b/hosts/tomato/hardware.nix index 7fdb646..f08e788 100644 --- a/hosts/tomato/hardware.nix +++ b/hosts/tomato/hardware.nix @@ -39,6 +39,7 @@ in linux-firmware broadcom-bt-firmware ]; + this.unfree.allowed = ["broadcom-bt-firmware"]; nixpkgs.hostPlatform = "x86_64-linux"; } 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; + }; +} |