diff options
author | Felix Bühler <Stunkymonkey@users.noreply.github.com> | 2024-01-26 22:13:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 22:13:11 +0100 |
commit | d9de6dd272bde241a1f2b97a351380462a4b9da5 (patch) | |
tree | 85b6406b44dcb3c85541e3e4827edfa95c737f86 /nixos | |
parent | 81aeec6a9d586e4905580edc167d9a9e24785eb6 (diff) | |
parent | 17243e6a84f3efe2b2b0d8d6eea9de16baff5046 (diff) | |
download | nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar.gz nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar.bz2 nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar.lz nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar.xz nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.tar.zst nixlib-d9de6dd272bde241a1f2b97a351380462a4b9da5.zip |
Merge pull request #284075 from rhoriguchi/nixos/esphome
nixos/esphome: add option to use ping to check online status of devices
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/home-automation/esphome.nix | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/services/home-automation/esphome.nix b/nixos/modules/services/home-automation/esphome.nix index 4fc007a97683..3c0fd8aed08a 100644 --- a/nixos/modules/services/home-automation/esphome.nix +++ b/nixos/modules/services/home-automation/esphome.nix @@ -63,6 +63,12 @@ in ''; type = types.listOf types.str; }; + + usePing = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc "Use ping to check online status of devices instead of mDNS"; + }; }; config = mkIf cfg.enable { @@ -74,8 +80,10 @@ in wantedBy = ["multi-user.target"]; path = [cfg.package]; - # platformio fails to determine the home directory when using DynamicUser - environment.PLATFORMIO_CORE_DIR = "${stateDir}/.platformio"; + environment = { + # platformio fails to determine the home directory when using DynamicUser + PLATFORMIO_CORE_DIR = "${stateDir}/.platformio"; + } // lib.optionalAttrs cfg.usePing { ESPHOME_DASHBOARD_USE_PING = "true"; }; serviceConfig = { ExecStart = "${cfg.package}/bin/esphome dashboard ${esphomeParams} ${stateDir}"; |