hyperhive/nix/templates/manager.nix

41 lines
983 B
Nix

{ pkgs, ... }:
{
boot.isNspawnContainer = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [ "claude-code" ];
environment.systemPackages = with pkgs; [
hyperhive
claude-code
git
coreutils-full
];
environment.etc."gitconfig".text = ''
[user]
name = hm1nd
email = hm1nd@hyperhive
[init]
defaultBranch = main
'';
systemd.services.hive-m1nd = {
description = "hive-m1nd manager harness";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
environment = {
HIVE_PORT = "8000";
HIVE_LABEL = "hm1nd";
};
# See note in agent-base.nix — `claude` has to be on the service PATH
# explicitly for the harness to shell out to it.
path = [ pkgs.claude-code ];
serviceConfig = {
ExecStart = "${pkgs.hyperhive}/bin/hive-m1nd serve";
Restart = "on-failure";
RestartSec = 2;
};
};
system.stateVersion = "25.11";
}