42 lines
1.3 KiB
Nix
42 lines
1.3 KiB
Nix
{ pkgs, slackerbot, ... }:
|
|
{
|
|
boot.isContainer = true;
|
|
networking.hostName = "agent";
|
|
|
|
networking.useNetworkd = true;
|
|
networking.useHostResolvConf = false;
|
|
systemd.network.enable = true;
|
|
networking.firewall.allowedTCPPorts = [ 1984 ];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
goose-cli
|
|
git
|
|
curl
|
|
ripgrep
|
|
# The bot passes this to goose as an MCP server (the send_file tool).
|
|
(writeShellScriptBin "slackerbot-tools" ''exec ${slackerbot}/bin/slackerbot "$@"'')
|
|
];
|
|
|
|
# Builds go through the host's nix-daemon, whose socket the bot bind-mounts in.
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
systemd.sockets.nix-daemon.enable = false;
|
|
systemd.services.nix-daemon.enable = false;
|
|
|
|
systemd.services.goose = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network-online.target" ];
|
|
wants = [ "network-online.target" ];
|
|
path = [ "/run/current-system/sw" ];
|
|
environment.HOME = "/root";
|
|
serviceConfig = {
|
|
EnvironmentFile = "/var/lib/slackerbot/agent.env";
|
|
ExecStart = "${pkgs.goose-cli}/bin/goose serve --host 0.0.0.0 --port 1984 --with-builtin developer";
|
|
WorkingDirectory = "/root";
|
|
Restart = "always";
|
|
RestartSec = 2;
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "25.11";
|
|
}
|