commit 55364e5860c067163c23f1d48e6fe0380759f27f parent 2aa16dbe97e8280b957da776b82a1430e1925dc0 Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 19 Nov 2021 18:23:51 +0100 systems/modules: fix isCurrentHost if no addrs Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | systems/modules/profiles/builder.nix | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/systems/modules/profiles/builder.nix b/systems/modules/profiles/builder.nix @@ -4,7 +4,11 @@ let inherit (lib) mkIf mkEnableOption importTOML filter; cfg = config.profiles.externalbuilder; metadata = importTOML ../../../ops/hosts.toml; - isCurrentHost = n: n.hostName != metadata.hosts.${config.networking.hostName}.addrs.v4; + currentHostIP = + if builtins.hasAttr "addrs" metadata.hosts.${config.networking.hostName} + then metadata.hosts.${config.networking.hostName}.addrs.v4 + else "0.0.0.0"; + isCurrentHost = n: n.hostName != currentHostIP; in { options = {