summaryrefslogtreecommitdiff
path: root/modules/server/virtualisation/containers/beszel-agent.nix
blob: 4e9ce350773e18bd55b433ea58a6b34737230698 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ secrets, config, ... }:
{
  virtualisation.oci-containers.containers.beszel-agent = {
    image = "henrygd/beszel-agent";
    autoStart = true;
    volumes = [ "/var/run/docker.sock:/var/run/docker.sock:ro" ];
    extraOptions = config.modules.containers.extraOptions ++ [ "--network=host" ];

    ports =
      let
        port = builtins.toString 45876;
      in
      [ "127.0.0.1:${port}:${port}" ];

    environment = {
      PORT = "45876";
      KEY = "ssh-ed25519 ${secrets.beszel_agent_public_key}";
    };
  };
}