From b1b11cf17ccc8a18beae8c664557282dd25150f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Thu, 14 May 2026 20:52:44 +0200 Subject: [PATCH] module: serve subcommand + runtime/state dirs --- nix/modules/hive-c0re.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index f3e0caa..90d6f1f 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -16,6 +16,11 @@ in defaultText = lib.literalExpression "pkgs.hyperhive"; description = "Package that provides /bin/hive-c0re."; }; + agentFlake = lib.mkOption { + type = lib.types.str; + default = "/etc/hyperhive#agent-base"; + description = "Flake reference passed to `nixos-container create --flake` when spawning sub-agents."; + }; }; config = lib.mkIf cfg.enable { @@ -23,9 +28,12 @@ in description = "hyperhive coordinator daemon"; wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/hive-c0re"; + ExecStart = "${cfg.package}/bin/hive-c0re --socket /run/hyperhive/host.sock serve --agent-flake ${cfg.agentFlake}"; Restart = "on-failure"; RestartSec = 2; + RuntimeDirectory = "hyperhive"; + RuntimeDirectoryMode = "0750"; + StateDirectory = "hyperhive"; }; }; };