Compare commits
18
Commits
47c160200f
...
trunk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7d27d8ea1 | ||
|
|
52641b8b10 | ||
|
|
256a9684fe | ||
|
|
6f74b4aff3 | ||
|
|
ae9a50f11e | ||
|
|
8c9ff95e68 | ||
|
|
b21b81caf4 | ||
|
|
17631704b1 | ||
|
|
cf29da55dc | ||
|
|
4d512e6f6c | ||
|
|
3dbcfe9ff1 | ||
|
|
d196fed0d8 | ||
|
|
491721aed3 | ||
|
|
faceb9d0ca | ||
|
|
8832a4495b | ||
|
|
3e268f4b22 | ||
|
|
c9d30a962c | ||
|
|
7176ce59d2 |
Generated
+39
-39
@@ -106,16 +106,16 @@
|
||||
"brew-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1786945682,
|
||||
"narHash": "sha256-VBESSoJccikdhxh3vp3SQeG7cZXTOulMvVkoSqNDEhs=",
|
||||
"lastModified": 1788591592,
|
||||
"narHash": "sha256-NbwVKwKLFl0oXub7oPjvmDaOygCtV2oboeKTu4xXFTk=",
|
||||
"owner": "Homebrew",
|
||||
"repo": "brew",
|
||||
"rev": "5b90e281d4e0c8fbd6ca4d8358276fb305b8d0bd",
|
||||
"rev": "08e85c4e42f5d8f1ea17c36cb59cf61c2ccb26c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Homebrew",
|
||||
"ref": "6.0.18",
|
||||
"ref": "6.0.22",
|
||||
"repo": "brew",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -126,11 +126,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787524125,
|
||||
"narHash": "sha256-P48TOQdIbB0PKMn4FTk6X0utbf0LemNlJ+bFcSbveGA=",
|
||||
"lastModified": 1789598303,
|
||||
"narHash": "sha256-hyAB8PqtE+2NPbXqFWFOVessao4ccpsQq6hKBfZPN0w=",
|
||||
"owner": "9001",
|
||||
"repo": "copyparty",
|
||||
"rev": "9de090265f8d063056320f41d984830839017a2f",
|
||||
"rev": "6867ccc51181e7965445c3d158ddddf9a8fd817e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -566,11 +566,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787377438,
|
||||
"narHash": "sha256-Sxu1NLTD/Ern6hFGLlZmtKCSct3YQXZI/lls8RE1XeM=",
|
||||
"lastModified": 1789267039,
|
||||
"narHash": "sha256-LWiBv9yAYFi2LPbUhDGHPGKYskJQjj2fw12OlyO1uQo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "65258d5c65a250189fde2e35f490d15e064c4c62",
|
||||
"rev": "ec172013fa62135f58fb58dd17ae9651e8f39727",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -587,11 +587,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787750582,
|
||||
"narHash": "sha256-FfIAV44k33i+IjC1+new2KyjyVGUzGtV89VHVP4eK1U=",
|
||||
"lastModified": 1789676441,
|
||||
"narHash": "sha256-mOvO5VvycuBtOUe5EYI54vrLsWe+2KF/82fmwKooe48=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "0a364342a66bcecfc8a00d2fc38c6c29eee7bc5e",
|
||||
"rev": "9d485f74cd27d17126ee34cb31005c39d20f741f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -753,11 +753,11 @@
|
||||
"brew-src": "brew-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787330919,
|
||||
"narHash": "sha256-LslMncqN7uOOH5S88WZtO/EVt2HwD8ltUnfyANk+mC0=",
|
||||
"lastModified": 1788981439,
|
||||
"narHash": "sha256-fEaFq0XgpgWFPLfpq1UK4/8ylHd2T0+fo6O3hKz1LUM=",
|
||||
"owner": "zhaofengli",
|
||||
"repo": "nix-homebrew",
|
||||
"rev": "b00218e4aec0e5bf07d61a0bb13f842faa582d7b",
|
||||
"rev": "09a921d0181146cf6163ec2cc1db7b6fd539a885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -806,11 +806,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1784642409,
|
||||
"narHash": "sha256-hcbDqFuySAJawljt5r0sKBCJKYnbtGD0T/ZIozH1Dq0=",
|
||||
"lastModified": 1789164534,
|
||||
"narHash": "sha256-DoYGPM6QpnYBLWj9gGw6ZwAzIX+HrAVov1BoT+8Jixo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "eaeb18da90024448a60eb1ec7132eafa4003404e",
|
||||
"rev": "72c92b11bb8289e6651c7fef29cc0a885fd6a255",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -837,11 +837,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1787498568,
|
||||
"narHash": "sha256-FoOSoBG7tEvOlGRTpWnVdY506Ner4y7r7UYO3OGgmE8=",
|
||||
"rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188",
|
||||
"lastModified": 1789546076,
|
||||
"narHash": "sha256-vWkSk5bbfTqdtMoSgD9FshACO8JCvXTFi+3cqEp0mH0=",
|
||||
"rev": "b1b875982b17dabde9b4a37f3e229e74913e6db3",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1060451.56c02bc00adc/nixexprs.tar.xz"
|
||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1074753.b1b875982b17/nixexprs.tar.zst"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
@@ -851,11 +851,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1787640266,
|
||||
"narHash": "sha256-tbu/95O8ZRmCj0kfSiDvz3YT7GSnD0fO6cxLRVYtXnU=",
|
||||
"rev": "f4f698677b11021a8f84f452e23ae9ef2427bec3",
|
||||
"lastModified": 1789542786,
|
||||
"narHash": "sha256-BGtBoaZNpOPDEBLTiWNFdYppnDjGhwrUq5/P15QwrrM=",
|
||||
"rev": "4c7870105e7f1fdf9c48688c8d7efc21abf0688a",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.8409.f4f698677b11/nixexprs.tar.xz"
|
||||
"url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.9904.4c7870105e7f/nixexprs.tar.zst"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
@@ -944,11 +944,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787514376,
|
||||
"narHash": "sha256-wS5a1tumQcmwamA4BpSvf2Idd/P/zOQNU1hY53EzfoM=",
|
||||
"lastModified": 1789510188,
|
||||
"narHash": "sha256-umec9LKkWjK89Yx4XpvQStkgfKvhK7GjVf5m21bjzKU=",
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"rev": "460dad9e777df4008309f1d731a47b299dc7b41e",
|
||||
"rev": "cdc7e7aaa7eb521bba1b38f54c3228d52cc31703",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1235,11 +1235,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786629091,
|
||||
"narHash": "sha256-gkig4nPi1CWc4Z50GBsjE4ygSE7hMpl/TwID2an2Cck=",
|
||||
"lastModified": 1789623319,
|
||||
"narHash": "sha256-kmlp8rPrvrXn58YiaANHKSWUijtUc7pwgerIywosOIM=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "a8627b21b9107c5711c96b84f32a9a4b3d45295f",
|
||||
"rev": "16954c1c360c3dc4d4b3b3e64df59f7e89452cb1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1334,11 +1334,11 @@
|
||||
"tinted-zed": "tinted-zed"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787175104,
|
||||
"narHash": "sha256-tzNjlb0loxeWlipvxSNAUUihloeTZoyGFhEen87yM9k=",
|
||||
"lastModified": 1787771653,
|
||||
"narHash": "sha256-DkkJSBOXWV/mja5Vy8az5g1KpZlsbUwlmH0BsQhowaQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "stylix",
|
||||
"rev": "a9e5a76a1b75b137f266e4f445e1eaba82e9783e",
|
||||
"rev": "5e3809851f486e7fc7e84b40f174c74b60ecc784",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -1450,11 +1450,11 @@
|
||||
},
|
||||
"vpn-confinement": {
|
||||
"locked": {
|
||||
"lastModified": 1785142579,
|
||||
"narHash": "sha256-WEPxDMiKt3uGVVu/aorHnIgYYW62mEq2Q+rlN3qH6bg=",
|
||||
"lastModified": 1789394839,
|
||||
"narHash": "sha256-trdjVJKmDBbzgbP8pd+R7iKbGkdRu0nmXgQlBR/hEiU=",
|
||||
"owner": "Maroka-chan",
|
||||
"repo": "VPN-Confinement",
|
||||
"rev": "b3aa71a7edfe6af748c23729d1bdec3b499741ff",
|
||||
"rev": "a21f66ccd9f644c3770ccdf287cb380c00192628",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -124,7 +124,7 @@ in {
|
||||
enable = true;
|
||||
allowedTCPPorts = [22 80 443 25777 25579 7567 21115 21116 21117 21118 21119];
|
||||
# tailscale will also need its UDP port open:
|
||||
allowedUDPPorts = [config.services.tailscale.port 25777 21116 25580];
|
||||
allowedUDPPorts = [config.services.tailscale.port 2456 2457 25777 21116 25580];
|
||||
trustedInterfaces = ["tailscale0"];
|
||||
/*
|
||||
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination ${snowbelle_ip}:80 # http
|
||||
@@ -146,12 +146,16 @@ in {
|
||||
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 25777 -j DNAT --to-destination ${lumiose_ip}:25777 # recpro mc
|
||||
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25579 -j DNAT --to-destination ${snowbelle_ip}:25579 # craftoria mc
|
||||
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 25580 -j DNAT --to-destination ${snowbelle_ip}:25580 # craftoria mc voice chat
|
||||
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 2456 -j DNAT --to-destination ${lumiose_ip}:2456 # valheim server
|
||||
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 2457 -j DNAT --to-destination ${lumiose_ip}:2457 # valheim server
|
||||
|
||||
# SNAT: ensure replies go back through VPS tailscale IP
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 25777 -d ${lumiose_ip}/32 -j SNAT --to-source ${vpsip4} # recpro mc
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p udp --dport 25777 -d ${lumiose_ip}/32 -j SNAT --to-source ${vpsip4} # recpro mc
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 25579 -d ${snowbelle_ip}/32 -j SNAT --to-source ${vpsip4} # craftoria mc
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p udp --dport 25580 -d ${snowbelle_ip}/32 -j SNAT --to-source ${vpsip4} # craftoria mc voicechat
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p udp --dport 2456 -d ${lumiose_ip}/32 -j SNAT --to-source ${vpsip4} # valheim server
|
||||
iptables -t nat -A POSTROUTING -o tailscale0 -p udp --dport 2457 -d ${lumiose_ip}/32 -j SNAT --to-source ${vpsip4} # valheim server
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -13,20 +13,20 @@ in {
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
#overrideLocalDns = true;
|
||||
#authKeyFile = authkey_file;
|
||||
};
|
||||
# services.tailscale = {
|
||||
# enable = true;
|
||||
# #overrideLocalDns = true;
|
||||
# #authKeyFile = authkey_file;
|
||||
# };
|
||||
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# tailscale-gui
|
||||
# ];
|
||||
|
||||
homebrew = {
|
||||
casks = [
|
||||
"tailscale-app"
|
||||
];
|
||||
};
|
||||
# homebrew = {
|
||||
# casks = [
|
||||
# "tailscale-app"
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ in {
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
#overrideLocalDns = true;
|
||||
#authKeyFile = authkey_file;
|
||||
};
|
||||
# services.tailscale = {
|
||||
# enable = true;
|
||||
# #overrideLocalDns = true;
|
||||
# #authKeyFile = authkey_file;
|
||||
# };
|
||||
|
||||
homebrew = {
|
||||
casks = [
|
||||
|
||||
@@ -38,14 +38,14 @@ in {
|
||||
path = "/holocron/users/blake/holocron";
|
||||
devices = ["piplup" "zygarde" "CEN-IT-07" "CEN-IT-00007" "yveltal"];
|
||||
id = "5voxg-c3he2";
|
||||
versioning = {
|
||||
type = "staggered";
|
||||
fsPath = "/holocron/users/blake/holocron/.stversions";
|
||||
params = {
|
||||
cleanInterval = "3600";
|
||||
maxAge = "0";
|
||||
};
|
||||
};
|
||||
# versioning = {
|
||||
# type = "staggered";
|
||||
# fsPath = "/holocron/users/blake/holocron/.stversions";
|
||||
# params = {
|
||||
# cleanInterval = "3600";
|
||||
# maxAge = "0";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
};
|
||||
options = {
|
||||
|
||||
@@ -35,7 +35,7 @@ in {
|
||||
description = "set uid and pid of ${service} user (matches port by default)";
|
||||
};
|
||||
motd_gs = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
type = lib.types.nullOr (lib.types.listOf lib.types.str);
|
||||
default = ["podman-valheim"];
|
||||
};
|
||||
backup = lib.mkOption {
|
||||
@@ -90,6 +90,7 @@ in {
|
||||
];
|
||||
ports = [
|
||||
"2456-2457:2456-2457/udp"
|
||||
"2456:80/tcp"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.data_dir}/config:/config"
|
||||
@@ -98,7 +99,8 @@ in {
|
||||
environment = {
|
||||
SERVER_NAME = "recpro";
|
||||
SERVER_PASS = "recoil727pro";
|
||||
WORLD_NAME = "";
|
||||
#WORLD_NAME = "";
|
||||
STATUS_HTTP = "true";
|
||||
TZ = homelab.tz;
|
||||
PUID = toString config.users.users.${service}.uid;
|
||||
PGID = toString config.users.groups.${service}.gid;
|
||||
@@ -112,7 +114,7 @@ in {
|
||||
};
|
||||
|
||||
# open firewall
|
||||
# networking.firewall.allowedTCPPorts = [cfg.port];
|
||||
networking.firewall.allowedTCPPorts = [cfg.port];
|
||||
networking.firewall.allowedUDPPorts = [2456 2457];
|
||||
|
||||
# backups valhiem with borg!
|
||||
|
||||
@@ -62,6 +62,7 @@ in {
|
||||
# enable the ${service} service
|
||||
services.${service} = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.jellyfin;
|
||||
openFirewall = true;
|
||||
user = service;
|
||||
group = service;
|
||||
|
||||
@@ -58,7 +58,7 @@ in {
|
||||
plugins = [
|
||||
"github.com/caddy-dns/cloudflare@v0.2.4"
|
||||
];
|
||||
hash = "sha256-PWadA5qr/gR2qDcT8l8u1Xku7LM2HIfWTLOkzezCYy0=";
|
||||
hash = "sha256-dQvk6ezY6TQ1J7PjhCXnThF/SqVgPwBO8/RXzHCY+js=";
|
||||
# Replace with the hash from the build error the first time you build.
|
||||
};
|
||||
email = "me@blakedheld.xyz";
|
||||
|
||||
@@ -29,6 +29,7 @@ in {
|
||||
"superflat.recoil.pro"
|
||||
"skyblock.recoil.pro"
|
||||
"cobblemon.recoil.pro"
|
||||
"valheim.recoil.pro"
|
||||
|
||||
# blakedheld.xyz
|
||||
#"blakedheld.xyz"
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
nixservice = "wger";
|
||||
service = "wger";
|
||||
cfg = config.homelab.${service};
|
||||
sec = config.sops.secrets;
|
||||
homelab = config.homelab;
|
||||
in {
|
||||
options.homelab.${service} = {
|
||||
enable = lib.mkEnableOption "enables ${service}";
|
||||
|
||||
# set port options
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 7707;
|
||||
description = "set port for ${service} (default: ${toString cfg.port}";
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${service}.${homelab.base_domain}";
|
||||
description = "set domain for ${service}";
|
||||
};
|
||||
data_dir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/var/lib/${service}";
|
||||
description = "set data directory for ${service}";
|
||||
};
|
||||
ids = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = cfg.port;
|
||||
description = "set uid and pid of ${service} user (matches port by default)";
|
||||
};
|
||||
backup = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "enable backups for ${service}";
|
||||
};
|
||||
motd = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = "podman-wger";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# declare ${service} group
|
||||
users.groups.${service} = {gid = lib.mkForce cfg.ids;};
|
||||
|
||||
# declare ${service} user
|
||||
users.users.${service} = {
|
||||
description = "${service} server user";
|
||||
uid = lib.mkForce cfg.ids;
|
||||
isSystemUser = true;
|
||||
home = cfg.data_dir;
|
||||
createHome = true;
|
||||
group = service;
|
||||
extraGroups = [];
|
||||
};
|
||||
|
||||
# still suss as fuck bro man fuck
|
||||
virtualisation.oci-containers.containers = {
|
||||
hass = {
|
||||
image = "homeassistant/home-assistant:stable";
|
||||
autoStart = true;
|
||||
extraOptions = [
|
||||
"--pull=newer"
|
||||
"--network=host"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.data_dir}:/config"
|
||||
];
|
||||
environment = {
|
||||
TZ = homelab.tz;
|
||||
PUID = toString config.users.users.${service}.uid;
|
||||
PGID = toString config.users.groups.${service}.gid;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# override umask to make permissions work out
|
||||
systemd.services.${service}.serviceConfig = {
|
||||
UMask = lib.mkForce "0007";
|
||||
};
|
||||
|
||||
# open firewall
|
||||
networking.firewall.allowedTCPPorts = [cfg.port 8123 21063 21064];
|
||||
networking.firewall.allowedUDPPorts = [5353];
|
||||
|
||||
# add to caddy for reverse proxy
|
||||
services.caddy.virtualHosts."${cfg.url}" = {
|
||||
serverAliases = ["${service}.${homelab.public_domain}"];
|
||||
extraConfig = ''
|
||||
tls internal
|
||||
reverse_proxy 127.0.0.1:${toString cfg.port} {
|
||||
|
||||
header_up Host {host}
|
||||
header_up X-Real-IP {remote_host}
|
||||
header_up X-Forwarded-For {remote_host}
|
||||
header_up X-Forwarded-Proto https
|
||||
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# add to glance
|
||||
homelab.glance.links.services = [
|
||||
{
|
||||
title = "wger";
|
||||
url = "https://hass.${homelab.public_domain}";
|
||||
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
icon = "di:${nixservice}";
|
||||
}
|
||||
];
|
||||
|
||||
# add to backups
|
||||
homelab.backups.baks = {
|
||||
${service} = {paths = [cfg.data_dir];};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user