Merge pull request #262565 from Atemu/nixos/firmware-mkEnableOption
nixos/hardware: use mkEnableOption
This commit is contained in:
commit
8a8a2a1071
@ -18,29 +18,16 @@ in {
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
hardware.enableAllFirmware = mkOption {
|
hardware.enableAllFirmware = mkEnableOption "all firmware regardless of license";
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Turn on this option if you want to enable all the firmware.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = mkOption {
|
hardware.enableRedistributableFirmware = mkEnableOption "firmware with a license allowing redistribution" // {
|
||||||
default = config.hardware.enableAllFirmware;
|
default = config.hardware.enableAllFirmware;
|
||||||
defaultText = lib.literalExpression "config.hardware.enableAllFirmware";
|
defaultText = lib.literalExpression "config.hardware.enableAllFirmware";
|
||||||
type = types.bool;
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Turn on this option if you want to enable all the firmware with a license allowing redistribution.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.wirelessRegulatoryDatabase = mkOption {
|
hardware.wirelessRegulatoryDatabase = mkEnableOption "loading the wireless regulatory database at boot" // {
|
||||||
default = false;
|
default = cfg.enableRedistributableFirmware || cfg.enableAllFirmware;
|
||||||
type = types.bool;
|
defaultText = literalMD "Enabled if proprietary firmware is allowed via {option}`enableRedistributableFirmware` or {option}`enableAllFirmware`.";
|
||||||
description = lib.mdDoc ''
|
|
||||||
Load the wireless regulatory database at boot.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -65,7 +52,6 @@ in {
|
|||||||
++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [
|
++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [
|
||||||
rtl8723bs-firmware
|
rtl8723bs-firmware
|
||||||
];
|
];
|
||||||
hardware.wirelessRegulatoryDatabase = true;
|
|
||||||
})
|
})
|
||||||
(mkIf cfg.enableAllFirmware {
|
(mkIf cfg.enableAllFirmware {
|
||||||
assertions = [{
|
assertions = [{
|
||||||
|
Loading…
Reference in New Issue
Block a user