os/hosts/giggles/lrad.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.1 KiB
Nix
Raw Permalink Normal View History

{
pkgs,
config,
...
}: let
2023-01-28 21:30:37 +00:00
serviceAddress = "10.10.41.11";
containerStateDir = "/data";
hostStateDir = "/srv/container/lrad";
in {
2023-01-28 21:30:37 +00:00
containers."lrad" = {
privateNetwork = true;
hostAddress = "10.10.41.1";
localAddress = serviceAddress;
bindMounts."${containerStateDir}" = {
hostPath = hostStateDir;
isReadOnly = false;
};
config = {
config,
pkgs,
...
}: {
networking.firewall.allowedTCPPorts = [63080];
2023-01-28 21:30:37 +00:00
#users.users."tang".isSystemUser = true;
systemd.services."tangd" = {
enable = true;
# TODO: require data/tangd to exist
serviceConfig = {
ExecStart = "${pkgs.tang}/bin/tangd ${containerStateDir}/data/tangd";
StandardInput = "socket";
StandardOutput = "socket";
StandardError = "journal";
User = "tang";
};
};
systemd.sockets."tangd" = {
enable = true;
listenStreams = ["63080"];
wantedBy = ["sockets.target"];
2023-01-28 21:30:37 +00:00
socketConfig = {
Accept = true;
};
};
};
};
}