module: serve subcommand + runtime/state dirs
This commit is contained in:
parent
90798b936e
commit
b1b11cf17c
1 changed files with 9 additions and 1 deletions
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue