3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #25636 from Mic92/firmware

hardware: add enableRedistributalFirmware
This commit is contained in:
Jörg Thalheim 2017-05-09 15:57:49 +01:00 committed by GitHub
commit 5385a8e216
16 changed files with 51 additions and 28 deletions

View file

@ -2,7 +2,9 @@
with lib;
{
let
cfg = config.hardware;
in {
###### interface
@ -12,7 +14,16 @@ with lib;
default = false;
type = types.bool;
description = ''
Turn on this option if you want to enable all the firmware shipped in linux-firmware.
Turn on this option if you want to enable all the firmware.
'';
};
hardware.enableRedistributalFirmware = mkOption {
default = false;
type = types.bool;
description = ''
Turn on this option if you want to enable all the firmware with a license allowing redistribution.
(i.e. free firmware and <literal>firmware-linux-nonfree</literal>)
'';
};
@ -21,15 +32,27 @@ with lib;
###### implementation
config = mkIf config.hardware.enableAllFirmware {
hardware.firmware = with pkgs; [
firmwareLinuxNonfree
intel2200BGFirmware
rtl8723bs-firmware
rtl8192su-firmware
] ++ optionals config.nixpkgs.config.allowUnfree [
broadcom-bt-firmware
];
};
config = mkMerge [
(mkIf (cfg.enableAllFirmware || cfg.enableRedistributalFirmware) {
hardware.firmware = with pkgs; [
firmwareLinuxNonfree
intel2200BGFirmware
rtl8723bs-firmware
rtl8192su-firmware
];
})
(mkIf cfg.enableAllFirmware {
assertions = [{
assertion = !cfg.enableAllFirmware || (config.nixpkgs.config.allowUnfree or false);
message = ''
the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files.
This requires nixpkgs.config.allowUnfree to be true.
An alternative is to use the hardware.enableRedistributalFirmware option.
'';
}];
hardware.firmware = with pkgs; [
broadcom-bt-firmware
];
})
];
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -23,7 +23,7 @@
config = lib.mkIf config.networking.enableIntel2100BGFirmware {
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
};

View file

@ -22,7 +22,7 @@
config = lib.mkIf config.networking.enableIntel3945ABGFirmware {
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
};

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -20,7 +20,7 @@
###### implementation
config = lib.mkIf config.networking.enableRalinkFirmware {
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
};
}

View file

@ -20,7 +20,7 @@
###### implementation
config = lib.mkIf config.networking.enableRTL8192cFirmware {
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
};
}

View file

@ -1,3 +1,3 @@
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -5,5 +5,5 @@
with lib;
{
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
}

View file

@ -50,7 +50,7 @@
];
# Include lots of firmware.
hardware.enableAllFirmware = true;
hardware.enableRedistributalFirmware = true;
imports =
[ ../hardware/network/zydas-zd1211.nix ];