From 3ef0f14925f16a173ca29bb8f1bc80e997f7c972 Mon Sep 17 00:00:00 2001 From: Arie Middelkoop Date: Thu, 12 Jan 2012 17:17:01 +0000 Subject: [PATCH] Added an option to enable the firmware from 'firmware-linux-nonfree' and 'firmware-linux-free'. svn path=/nixos/trunk/; revision=31502 --- modules/hardware/firmware-free.nix | 26 ++++++++++++++++++++++++++ modules/hardware/firmware-nonfree.nix | 26 ++++++++++++++++++++++++++ modules/module-list.nix | 2 ++ 3 files changed, 54 insertions(+) create mode 100644 modules/hardware/firmware-free.nix create mode 100644 modules/hardware/firmware-nonfree.nix diff --git a/modules/hardware/firmware-free.nix b/modules/hardware/firmware-free.nix new file mode 100644 index 000000000000..ea21a5ae38d2 --- /dev/null +++ b/modules/hardware/firmware-free.nix @@ -0,0 +1,26 @@ +{pkgs, config, ...}: + +{ + + ###### interface + + options = { + + hardware.enableFirmwareLinuxFree = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want the set of firmware of the linux-firmware-free package. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.hardware.enableFirmwareLinuxFree { + hardware.firmware = [ pkgs.firmwareLinuxFree ]; + }; + +} diff --git a/modules/hardware/firmware-nonfree.nix b/modules/hardware/firmware-nonfree.nix new file mode 100644 index 000000000000..14cfaf0405b8 --- /dev/null +++ b/modules/hardware/firmware-nonfree.nix @@ -0,0 +1,26 @@ +{pkgs, config, ...}: + +{ + + ###### interface + + options = { + + hardware.enableFirmwareLinuxNonfree = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want the set of firmware of the non-free package. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.hardware.enableFirmwareLinuxNonfree { + hardware.firmware = [ pkgs.firmwareLinuxNonfree ]; + }; + +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 6c8159d1c42b..6781e1b7a9e0 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -20,6 +20,8 @@ ./hardware/network/rt73.nix ./hardware/network/rtl8192c.nix ./hardware/pcmcia.nix + ./hardware/firmware-nonfree.nix + ./hardware/firmware-free.nix ./installer/generations-dir/generations-dir.nix ./installer/grub/grub.nix ./installer/init-script/init-script.nix