Merge pull request #25636 from Mic92/firmware
hardware: add enableRedistributalFirmware
This commit is contained in:
commit
5385a8e216
@ -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
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
config = lib.mkIf config.networking.enableIntel2100BGFirmware {
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
|
||||
};
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
config = lib.mkIf config.networking.enableIntel3945ABGFirmware {
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
###### implementation
|
||||
|
||||
config = lib.mkIf config.networking.enableRalinkFirmware {
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
###### implementation
|
||||
|
||||
config = lib.mkIf config.networking.enableRTL8192cFirmware {
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
with lib;
|
||||
|
||||
{
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@
|
||||
];
|
||||
|
||||
# Include lots of firmware.
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.enableRedistributalFirmware = true;
|
||||
|
||||
imports =
|
||||
[ ../hardware/network/zydas-zd1211.nix ];
|
||||
|
Loading…
Reference in New Issue
Block a user