Compare commits

...

3 Commits

4 changed files with 49 additions and 8 deletions

42
hosts/pi4/actual.nix Normal file
View File

@ -0,0 +1,42 @@
{ config, common, ... }:
let
domain = "beta.budget.${common.domain}";
in
{
networking.nat = {
enable = true;
internalInterfaces = [ "ve-*" ];
externalInterface = "wlan0";
# Lazy IPv6 connectivity for the container
enableIPv6 = true;
};
containers.actual = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.10.188";
localAddress = "192.168.10.11";
config =
{ ... }:
{
services = {
actual = {
enable = true;
settings = {
port = 8084;
loginMethod = "password";
};
};
};
system.stateVersion = common.system.version;
};
};
services.nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${config.containers.actual.localAddress}:8084";
proxyWebsockets = true;
};
};
}

View File

@ -3,6 +3,7 @@
{
imports = with lib.custom; [
(relativeToBase "modules")
./actual.nix
./boot.nix
./caddy.nix
./forgejo.nix

View File

@ -1,3 +1,5 @@
{ common, ... }:
{
networking = {
firewall = {
@ -6,13 +8,8 @@
80
443
];
trustedInterfaces = [ "tailscale0" ];
extraInputRules =
let
localIPv4Range = "192.168.10.0/24";
in
''
ip saddr ${localIPv4Range} accept
extraInputRules = ''
ip saddr ${common.localIpRange} accept
'';
};
nftables.enable = true;

View File

@ -16,6 +16,7 @@ rec {
domain = "martials.no";
tailnetDomain = "dns.${domain}";
localIpPrefix = "192.168.10.";
localIpRange = "${localIpPrefix}0/24";
localIpAddr = subAddr: "${localIpPrefix}${builtins.toString subAddr}";
tailnetAddr = host: "${host}.${tailnetDomain}";