diff --git a/nix/host-modules/hive-c0re/default.nix b/nix/host-modules/hive-c0re/default.nix index ce89b2fe..d2cc0b74 100644 --- a/nix/host-modules/hive-c0re/default.nix +++ b/nix/host-modules/hive-c0re/default.nix @@ -34,6 +34,15 @@ let [credential "http://${config.services.hyperhive.forge.domain}"] helper = hive-forge username = core + [http] + # Abort a stalled fetch instead of blocking startup indefinitely. If a + # git+http transfer (e.g. `nix flake lock` of the forge-hosted config + # inputs) drops below 1 KiB/s for 30s -- forge unreachable / not ready + # on cold boot -- git fails fast rather than hanging the whole daemon. + # Pairs with GIT_TERMINAL_PROMPT=0 (no credential-prompt hang) and the + # migration shellout timeout in migrate.rs. + lowSpeedLimit = 1024 + lowSpeedTime = 30 ''; # git credential helper for hive-core's authenticated fetches of the diff --git a/nix/host-modules/hive-c0re/environment.nix b/nix/host-modules/hive-c0re/environment.nix index 7b65ee02..285c75c2 100644 --- a/nix/host-modules/hive-c0re/environment.nix +++ b/nix/host-modules/hive-c0re/environment.nix @@ -18,6 +18,15 @@ in # the writable StateDirectory. HOME = "/var/lib/hyperhive"; HYPERHIVE_GIT = "${pkgs.git}/bin/git"; + # Never let git block on an interactive credential prompt. hive-core is a + # TTY-less system user, so a prompt (e.g. the forge credential helper + # returns nothing because the forge isn't reachable yet on cold boot) + # would hang forever — this is what froze the whole daemon during startup + # migration's `nix flake lock` of the forge-hosted config inputs. With + # this set, git fails fast instead of prompting. Paired with the git http + # low-speed abort in `safeDirGitconfig` (bounds a stalled transfer) and + # the 120s migration shellout timeout in migrate.rs. + GIT_TERMINAL_PROMPT = "0"; # No HIVE_STATIC_DIR: the gateway static-serves the dashboard dist # (see the hive-gateway module); this router is API-only. # Path to the base agent frontend dist. hive-c0re's