summary refs log tree commit diff
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2023-10-21 17:30:36 +0200
committerAtemu <atemu.main@gmail.com>2023-10-21 17:30:36 +0200
commit5a137cf6070a132be840562b68cdda8734ad2841 (patch)
tree46456fc2ad0dd6456e21da9bf4890ddd30d22276
parent7c9cc5a6e5d38010801741ac830a3f8fd667a7a0 (diff)
downloadnixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar.gz
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar.bz2
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar.lz
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar.xz
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.tar.zst
nixpkgs-5a137cf6070a132be840562b68cdda8734ad2841.zip
nixos/hardware: use mkEnableOption
Also made the default of hardware.wirelessRegulatoryDatabase part of the option
declaration, not the implementation.
-rw-r--r--nixos/modules/hardware/all-firmware.nix24
1 files changed, 5 insertions, 19 deletions
diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix
index 08141bb0e87..6f58e848b38 100644
--- a/nixos/modules/hardware/all-firmware.nix
+++ b/nixos/modules/hardware/all-firmware.nix
@@ -18,29 +18,16 @@ in {
 
   options = {
 
-    hardware.enableAllFirmware = mkOption {
-      default = false;
-      type = types.bool;
-      description = lib.mdDoc ''
-        Turn on this option if you want to enable all the firmware.
-      '';
-    };
+    hardware.enableAllFirmware = mkEnableOption "all firmware regardless of license";
 
-    hardware.enableRedistributableFirmware = mkOption {
+    hardware.enableRedistributableFirmware = mkEnableOption "firmware with a license allowing redistribution" // {
       default = 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 {
-      default = false;
-      type = types.bool;
-      description = lib.mdDoc ''
-        Load the wireless regulatory database at boot.
-      '';
+    hardware.wirelessRegulatoryDatabase = mkEnableOption "loading the wireless regulatory database at boot" // {
+      default = cfg.enableRedistributableFirmware || cfg.enableAllFirmware;
+      defaultText = literalMD "Enabled if proprietary firmware is allowed via {option}`enableRedistributableFirmware` or {option}`enableAllFirmware`.";
     };
 
   };
@@ -65,7 +52,6 @@ in {
         ++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [
         rtl8723bs-firmware
       ];
-      hardware.wirelessRegulatoryDatabase = true;
     })
     (mkIf cfg.enableAllFirmware {
       assertions = [{