Files
nix-config/hosts/nas/apps/actual/default.nix
2025-05-22 09:36:09 -05:00

61 lines
1.3 KiB
Nix

{ ... }:
let
actualPort = 3333;
hostDataDir = "/media/nas/ssd/nix-app-data/actual";
dataDir = "/var/lib/actual";
hostAddress = "10.0.1.18";
localAddress = "10.0.3.18";
in
{
containers.actual = {
autoStart = true;
privateNetwork = true;
hostAddress = hostAddress;
localAddress = localAddress;
bindMounts = {
${dataDir} = {
hostPath = hostDataDir;
isReadOnly = false;
};
};
config = { lib, ... }:
{
services.actual = {
enable = true;
openFirewall = true;
settings = {
trustedProxies = [ hostAddress ];
port = actualPort;
config = {
dataDir = dataDir;
};
};
};
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ actualPort ];
};
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = lib.mkForce false;
};
services.resolved.enable = true;
system.stateVersion = "23.11";
};
};
networking.nat = {
forwardPorts = [
{
destination = "${localAddress}:${toString actualPort}";
sourcePort = actualPort;
}
];
};
}