Commit 55364e5860c0

Vincent Demeester <vincent@sbr.pm>
2021-11-19 18:23:51
systems/modules: fix isCurrentHost if no addrs
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 2aa16db
Changed files (1)
systems
modules
profiles
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 = {