summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvin <vin@vineetk.net>2025-12-10 04:51:10 -0500
committervin <vin@vineetk.net>2025-12-10 04:51:10 -0500
commitae8bc969c9efcb800e3476dd49ac484cd8d67d22 (patch)
treec40fa22a68b8c33fe5b168835cbbdbb4214bae5a
parent29241ed554ab7d9a6a872b32462a38377c094c53 (diff)
remove tailscale
-rw-r--r--flake.lock22
-rw-r--r--hosts/demiurge/default.nix134
2 files changed, 106 insertions, 50 deletions
diff --git a/flake.lock b/flake.lock
index ff49e7e..648b7d4 100644
--- a/flake.lock
+++ b/flake.lock
@@ -10,11 +10,11 @@
10 "systems": "systems" 10 "systems": "systems"
11 }, 11 },
12 "locked": { 12 "locked": {
13 "lastModified": 1754433428, 13 "lastModified": 1762618334,
14 "narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=", 14 "narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=",
15 "owner": "ryantm", 15 "owner": "ryantm",
16 "repo": "agenix", 16 "repo": "agenix",
17 "rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d", 17 "rev": "fcdea223397448d35d9b31f798479227e80183f6",
18 "type": "github" 18 "type": "github"
19 }, 19 },
20 "original": { 20 "original": {
@@ -163,11 +163,11 @@
163 ] 163 ]
164 }, 164 },
165 "locked": { 165 "locked": {
166 "lastModified": 1759536080, 166 "lastModified": 1765337252,
167 "narHash": "sha256-0aXlKPxm2M+F5oywX2TTbY0e6h+tQ+6OYyx7UZn3A4A=", 167 "narHash": "sha256-HuWQp8fM25fyWflbuunQkQI62Hg0ecJxWD52FAgmxqY=",
168 "owner": "nix-community", 168 "owner": "nix-community",
169 "repo": "home-manager", 169 "repo": "home-manager",
170 "rev": "edafd6da1936426708f1be0b1a4288007f16639a", 170 "rev": "13cc1efd78b943b98c08d74c9060a5b59bf86921",
171 "type": "github" 171 "type": "github"
172 }, 172 },
173 "original": { 173 "original": {
@@ -184,8 +184,8 @@
184 ] 184 ]
185 }, 185 },
186 "locked": { 186 "locked": {
187 "lastModified": 1759197167, 187 "lastModified": 0,
188 "narHash": "sha256-AwyoFll5dXyxLtipAdfthKSPKaL0nifDEhAKQ8baV1c=", 188 "narHash": "sha256-55vcu6qdgWbK8AczPidx3oZch+2lgxIT0wXT3m69z54=",
189 "path": "/data/src/clones/llm/llama.cpp", 189 "path": "/data/src/clones/llm/llama.cpp",
190 "type": "path" 190 "type": "path"
191 }, 191 },
@@ -211,11 +211,11 @@
211 }, 211 },
212 "nixpkgs": { 212 "nixpkgs": {
213 "locked": { 213 "locked": {
214 "lastModified": 1759381078, 214 "lastModified": 1765186076,
215 "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", 215 "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=",
216 "owner": "nixos", 216 "owner": "nixos",
217 "repo": "nixpkgs", 217 "repo": "nixpkgs",
218 "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", 218 "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8",
219 "type": "github" 219 "type": "github"
220 }, 220 },
221 "original": { 221 "original": {
diff --git a/hosts/demiurge/default.nix b/hosts/demiurge/default.nix
index 6b7a55d..263d509 100644
--- a/hosts/demiurge/default.nix
+++ b/hosts/demiurge/default.nix
@@ -63,7 +63,7 @@
63 # decrypt agenix secrets 63 # decrypt agenix secrets
64 age.secrets = { 64 age.secrets = {
65 wg0_demiurge.file = ../../secrets/wg0_demiurge.age; 65 wg0_demiurge.file = ../../secrets/wg0_demiurge.age;
66 tailscale_demiurge.file = ../../secrets/tailscale_demiurge.age; 66 wg1_demiurge.file = ../../secrets/wg1_demiurge.age;
67 }; 67 };
68 68
69 # boot options 69 # boot options
@@ -92,7 +92,7 @@
92 9943 92 9943
93 9944 93 9944
94 ]; 94 ];
95 allowedUDPPorts = [ 9943 9944 51413 ]; 95 allowedUDPPorts = [ 9943 9944 51413 51820 ];
96 }; 96 };
97 97
98 interfaces.eth0 = { 98 interfaces.eth0 = {
@@ -109,33 +109,99 @@
109 }; 109 };
110 110
111 # mullvad 111 # mullvad
112 wg-quick.interfaces.wg0 = { 112 wg-quick.interfaces = {
113 address = [ 113 wg0 = {
114 "10.68.117.111/32" 114 address = [
115 "fc00:bbbb:bbbb:bb01::5:756e/128" 115 "10.68.117.111/32"
116 ]; 116 "fc00:bbbb:bbbb:bb01::5:756e/128"
117 privateKeyFile = config.age.secrets.wg0_demiurge.path; 117 ];
118 118 privateKeyFile = config.age.secrets.wg0_demiurge.path;
119 # supposed to be done by tailscale instead \_(:/)_/
120 postUp = ''
121 ip route add 100.64.0.0/24 dev tailscale0
122 ip route add 100.100.100.100/32 dev tailscale0
123 '';
124 postDown = ''
125 ip route del 100.64.0.0/24 dev tailscale0
126 ip route del 100.100.100.100/32 dev tailscale0
127 '';
128 119
129 peers = [ 120 peers = [
130 { 121 {
131 allowedIPs = [ 122 allowedIPs = [
132 "0.0.0.0/0" 123 "0.0.0.0/0"
133 "::0/0" 124 "::0/0"
134 ]; 125 ];
135 endpoint = "45.134.142.206:51820"; 126 endpoint = "45.134.142.206:51820";
136 publicKey = "H5t7PsMDnUAHrR8D2Jt3Mh6N6w43WmCzrOHShlEU+zw="; 127 publicKey = "H5t7PsMDnUAHrR8D2Jt3Mh6N6w43WmCzrOHShlEU+zw=";
137 } 128 }
138 ]; 129 ];
130 };
131 wg1 = {
132 address = [
133 "10.0.13.2/24"
134 "fd00:b0ba:cafe:babe::2/64"
135 ];
136 privateKeyFile = config.age.secrets.wg1_demiurge.path;
137 listenPort = 51820;
138 mtu = 1420;
139 table = null;
140 postUp = ''
141# IPv4 NAT
142iptables -t nat -I POSTROUTING 1 -s 10.0.13.4/32 -o wg0 -j MASQUERADE
143# IPv6 NAT
144ip6tables -t nat -I POSTROUTING 1 -s fd00:b0ba:cafe:babe::4/128 -o wg0 -j MASQUERADE
145
146# IPv4 Forwarding Chain
147iptables -N WG1-FWD
148iptables -I FORWARD 1 -j WG1-FWD
149iptables -A WG1-FWD -i wg1 -o wg1 -j ACCEPT
150iptables -A WG1-FWD -i wg1 -o wg0 -j ACCEPT
151iptables -A WG1-FWD -i wg0 -o wg1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
152
153# IPv6 Forwarding Chain
154ip6tables -N WG1-FWD
155ip6tables -I FORWARD 1 -j WG1-FWD
156ip6tables -A WG1-FWD -i wg1 -o wg1 -j ACCEPT
157ip6tables -A WG1-FWD -i wg1 -o wg0 -j ACCEPT
158ip6tables -A WG1-FWD -i wg0 -o wg1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
159 '';
160 preDown = ''
161# IPv4 NAT
162iptables -t nat -D POSTROUTING -s 10.0.13.4/32 -o wg0 -j MASQUERADE
163# IPv6 NAT
164ip6tables -t nat -D POSTROUTING -s fd00:b0ba:cafe:babe::4/128 -o wg0 -j MASQUERADE
165
166# IPv4 Forwarding Chain
167iptables -D FORWARD -j WG1-FWD
168iptables -F WG1-FWD
169iptables -X WG1-FWD
170
171# IPv6 Forwarding Chain
172ip6tables -D FORWARD -j WG1-FWD
173ip6tables -F WG1-FWD
174ip6tables -X WG1-FWD
175 '';
176
177 peers = [
178 {
179 # saklas.epistemia
180 publicKey = "XvRailvccuc7LJIF4aaYM/MLkU4upiprwFlCfBllhl0=";
181 endpoint = "157.180.125.215:51820";
182 allowedIPs = [ "10.0.13.1/32" "fd00:b0ba:cafe:babe::1/128" ];
183 persistentKeepalive = 25;
184 }
185 {
186 # hastur.epistemia
187 publicKey = "1ketYziRhoUmpbrj/60O5DYbcPacvmEoFQqa/NntSnc=";
188 allowedIPs = [ "10.0.13.3/32" "fd00:b0ba:cafe:babe::3/128" ];
189 persistentKeepalive = 25;
190 }
191 {
192 # iphonebob.epistemia
193 publicKey = "Xn0EmeRZdpMejBgzr98mYtb/2f5O58GAzQLNZV/SS30=";
194 allowedIPs = [ "10.0.13.4/32" "fd00:b0ba:cafe:babe::4/128" ];
195 persistentKeepalive = 25;
196 }
197 {
198 # lab.epistemia
199 publicKey = "iMDEwvXjPAlQH8ZCmP63FM5ICYIFIX5XIyGxjnXoNVE=";
200 allowedIPs = [ "10.0.13.5/32" "fd00:b0ba:cafe:babe::5/128" ];
201 persistentKeepalive = 25;
202 }
203 ];
204 };
139 }; 205 };
140 }; 206 };
141 207
@@ -155,13 +221,6 @@
155 }; 221 };
156 222
157 services = { 223 services = {
158 # vpn
159 # TODO replace with wireguard again
160 tailscale = {
161 authKeyFile = config.age.secrets.tailscale_demiurge.path;
162 extraSetFlags = [ "--advertise-exit-node" ];
163 };
164
165 # media server 224 # media server
166 jellyfin = { 225 jellyfin = {
167 enable = true; 226 enable = true;
@@ -275,7 +334,7 @@
275 openssh.listenAddresses = [ 334 openssh.listenAddresses = [
276 { addr = "127.0.0.1"; port = 22; } 335 { addr = "127.0.0.1"; port = 22; }
277 { addr = "192.168.1.2"; port = 22; } 336 { addr = "192.168.1.2"; port = 22; }
278 { addr = "100.64.0.2"; port = 22; } 337 { addr = "10.0.13.2"; port = 22; }
279 ]; 338 ];
280 339
281 # llm 340 # llm
@@ -764,8 +823,5 @@
764 }; 823 };
765 }; 824 };
766 825
767 # extra systemd stuff
768 systemd.services.nginx.after = [ "tailscaled-autoconnect.service" ];
769
770 system.stateVersion = "24.05"; 826 system.stateVersion = "24.05";
771} 827}