about summary refs log tree commit diff
path: root/nixos/modules/services/home-automation
diff options
context:
space:
mode:
authorh7x4 <h7x4@nani.wtf>2023-11-27 01:19:27 +0100
committerh7x4 <h7x4@nani.wtf>2023-11-27 01:28:36 +0100
commit0a37316d6cfea44280f4470b6867a711a24606bd (patch)
tree0dce949073e1f1647975a2ec3adfb7facdbb8ac4 /nixos/modules/services/home-automation
parent9cc575741df943328b2dbbf6ef7c5dfd49c1bbe0 (diff)
treewide: use `mkPackageOption`
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
Diffstat (limited to 'nixos/modules/services/home-automation')
-rw-r--r--nixos/modules/services/home-automation/esphome.nix7
-rw-r--r--nixos/modules/services/home-automation/zigbee2mqtt.nix9
2 files changed, 2 insertions, 14 deletions
diff --git a/nixos/modules/services/home-automation/esphome.nix b/nixos/modules/services/home-automation/esphome.nix
index 080c8876382f9..1e708ec04ab10 100644
--- a/nixos/modules/services/home-automation/esphome.nix
+++ b/nixos/modules/services/home-automation/esphome.nix
@@ -26,12 +26,7 @@ in
   options.services.esphome = {
     enable = mkEnableOption (mdDoc "esphome");
 
-    package = mkOption {
-      type = types.package;
-      default = pkgs.esphome;
-      defaultText = literalExpression "pkgs.esphome";
-      description = mdDoc "The package to use for the esphome command.";
-    };
+    package = lib.mkPackageOption pkgs "esphome" { };
 
     enableUnixSocket = mkOption {
       type = types.bool;
diff --git a/nixos/modules/services/home-automation/zigbee2mqtt.nix b/nixos/modules/services/home-automation/zigbee2mqtt.nix
index 6b5bd8a0d9bbc..a653e49a09f62 100644
--- a/nixos/modules/services/home-automation/zigbee2mqtt.nix
+++ b/nixos/modules/services/home-automation/zigbee2mqtt.nix
@@ -20,14 +20,7 @@ in
   options.services.zigbee2mqtt = {
     enable = mkEnableOption (lib.mdDoc "zigbee2mqtt service");
 
-    package = mkOption {
-      description = lib.mdDoc "Zigbee2mqtt package to use";
-      default = pkgs.zigbee2mqtt;
-      defaultText = literalExpression ''
-        pkgs.zigbee2mqtt
-      '';
-      type = types.package;
-    };
+    package = mkPackageOption pkgs "zigbee2mqtt" { };
 
     dataDir = mkOption {
       description = lib.mdDoc "Zigbee2mqtt data directory";