Compare commits
3 Commits
70b5d5fd4d
...
3e718fadfc
Author | SHA1 | Date | |
---|---|---|---|
3e718fadfc
|
|||
763ee6312a
|
|||
5704ebe712
|
42
hosts/pi4/actual.nix
Normal file
42
hosts/pi4/actual.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = with lib.custom; [
|
imports = with lib.custom; [
|
||||||
(relativeToBase "modules")
|
(relativeToBase "modules")
|
||||||
|
./actual.nix
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./caddy.nix
|
./caddy.nix
|
||||||
./forgejo.nix
|
./forgejo.nix
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{ common, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
@ -6,14 +8,9 @@
|
|||||||
80
|
80
|
||||||
443
|
443
|
||||||
];
|
];
|
||||||
trustedInterfaces = [ "tailscale0" ];
|
extraInputRules = ''
|
||||||
extraInputRules =
|
ip saddr ${common.localIpRange} accept
|
||||||
let
|
'';
|
||||||
localIPv4Range = "192.168.10.0/24";
|
|
||||||
in
|
|
||||||
''
|
|
||||||
ip saddr ${localIPv4Range} accept
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
nftables.enable = true;
|
nftables.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -16,6 +16,7 @@ rec {
|
|||||||
domain = "martials.no";
|
domain = "martials.no";
|
||||||
tailnetDomain = "dns.${domain}";
|
tailnetDomain = "dns.${domain}";
|
||||||
localIpPrefix = "192.168.10.";
|
localIpPrefix = "192.168.10.";
|
||||||
|
localIpRange = "${localIpPrefix}0/24";
|
||||||
localIpAddr = subAddr: "${localIpPrefix}${builtins.toString subAddr}";
|
localIpAddr = subAddr: "${localIpPrefix}${builtins.toString subAddr}";
|
||||||
tailnetAddr = host: "${host}.${tailnetDomain}";
|
tailnetAddr = host: "${host}.${tailnetDomain}";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user