mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
nixos/esphome: add option to use ping to check online status of devices
This commit is contained in:
parent
1704052d67
commit
17243e6a84
|
@ -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}";
|
||||
|
|
Loading…
Reference in a new issue