diff options
| author | vin <vin@vineetk.net> | 2025-09-21 14:22:46 -0400 |
|---|---|---|
| committer | vin <vin@vineetk.net> | 2025-09-21 14:22:46 -0400 |
| commit | 058bfbfa8fc9d4a945f2455be24b02f96e8bdbe8 (patch) | |
| tree | 05137a156c1cc02a81fc25d659450797f4f886f3 | |
| parent | e34fc237e405e79dff3fa27f6124a4ec4a2e25ea (diff) | |
switch to exwm
| -rw-r--r-- | home.nix | 18 | ||||
| -rw-r--r-- | hosts/demiurge/default.nix | 164 | ||||
| -rw-r--r-- | secrets/secrets.nix | 5 | ||||
| -rw-r--r-- | secrets/tailscale_demiurge.age | bin | 0 -> 384 bytes | |||
| -rw-r--r-- | secrets/tailscale_hastur.age | 7 | ||||
| -rw-r--r-- | secrets/tailscale_saklas.age | 8 |
6 files changed, 78 insertions, 124 deletions
| @@ -129,9 +129,9 @@ in | |||
| 129 | ]; | 129 | ]; |
| 130 | 130 | ||
| 131 | sessionVariables = { | 131 | sessionVariables = { |
| 132 | EDITOR = "nvim"; | 132 | EDITOR = "emacsclient -r"; |
| 133 | VISUAL = "nvim"; | 133 | VISUAL = "emacsclient -t"; |
| 134 | PAGER = "page"; | 134 | PAGER = "less"; |
| 135 | LESS = "-iR"; | 135 | LESS = "-iR"; |
| 136 | LESSHISTFILE = "/dev/null"; | 136 | LESSHISTFILE = "/dev/null"; |
| 137 | BROWSER = "qutebrowser"; | 137 | BROWSER = "qutebrowser"; |
| @@ -304,6 +304,8 @@ in | |||
| 304 | 304 | ||
| 305 | aerc.enable = true; | 305 | aerc.enable = true; |
| 306 | 306 | ||
| 307 | emacs.enable = true; | ||
| 308 | |||
| 307 | foot = { | 309 | foot = { |
| 308 | enable = true; | 310 | enable = true; |
| 309 | 311 | ||
| @@ -638,6 +640,16 @@ in | |||
| 638 | 640 | ||
| 639 | poweralertd.enable = true; | 641 | poweralertd.enable = true; |
| 640 | 642 | ||
| 643 | emacs = { | ||
| 644 | enable = false; | ||
| 645 | client.enable = true; | ||
| 646 | startWithUserSession = true; | ||
| 647 | extraOptions = [ | ||
| 648 | "-f" | ||
| 649 | "exwm-wm-mode" | ||
| 650 | ]; | ||
| 651 | }; | ||
| 652 | |||
| 641 | redshift = { | 653 | redshift = { |
| 642 | enable = false; | 654 | enable = false; |
| 643 | dawnTime = "07:00"; | 655 | dawnTime = "07:00"; |
diff --git a/hosts/demiurge/default.nix b/hosts/demiurge/default.nix index f3259df..9c781ca 100644 --- a/hosts/demiurge/default.nix +++ b/hosts/demiurge/default.nix | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | # decrypt agenix secrets | 59 | # decrypt agenix secrets |
| 60 | age.secrets = { | 60 | age.secrets = { |
| 61 | wg0_demiurge.file = ../../secrets/wg0_demiurge.age; | 61 | wg0_demiurge.file = ../../secrets/wg0_demiurge.age; |
| 62 | wg1_demiurge.file = ../../secrets/wg1_demiurge.age; | 62 | tailscale_demiurge.file = ../../secrets/tailscale_demiurge.age; |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | # boot options | 65 | # boot options |
| @@ -120,109 +120,33 @@ | |||
| 120 | interface = "eth0"; | 120 | interface = "eth0"; |
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | wireguard.interfaces = { | 123 | # mullvad |
| 124 | # mullvad | 124 | wireguard.interfaces.wg0 = { |
| 125 | wg0 = { | 125 | ips = [ |
| 126 | ips = [ | 126 | "10.68.117.111/32" |
| 127 | "10.68.117.111/32" | 127 | "fc00:bbbb:bbbb:bb01::5:756e/128" |
| 128 | "fc00:bbbb:bbbb:bb01::5:756e/128" | 128 | ]; |
| 129 | ]; | 129 | privateKeyFile = config.age.secrets.wg0_demiurge.path; |
| 130 | privateKeyFile = config.age.secrets.wg0_demiurge.path; | 130 | |
| 131 | 131 | postSetup = '' | |
| 132 | postSetup = '' | 132 | ip route add 45.134.142.206 via 192.168.1.1 |
| 133 | ip route add 45.134.142.206 via 192.168.1.1 | 133 | ip route add default via 45.134.142.206 |
| 134 | ip route add default via 45.134.142.206 | 134 | ''; |
| 135 | ''; | 135 | postShutdown = '' |
| 136 | postShutdown = '' | 136 | ip route del default via 45.134.142.206 |
| 137 | ip route del default via 45.134.142.206 | 137 | ip route del 45.134.142.206 via 192.168.1.1 |
| 138 | ip route del 45.134.142.206 via 192.168.1.1 | 138 | ''; |
| 139 | ''; | 139 | |
| 140 | 140 | peers = [ | |
| 141 | peers = [ | 141 | { |
| 142 | { | 142 | allowedIPs = [ |
| 143 | allowedIPs = [ | 143 | "0.0.0.0/0" |
| 144 | "0.0.0.0/0" | 144 | "::0/0" |
| 145 | "::0/0" | 145 | ]; |
| 146 | ]; | 146 | endpoint = "45.134.142.206:51820"; |
| 147 | endpoint = "45.134.142.206:51820"; | 147 | publicKey = "H5t7PsMDnUAHrR8D2Jt3Mh6N6w43WmCzrOHShlEU+zw="; |
| 148 | publicKey = "H5t7PsMDnUAHrR8D2Jt3Mh6N6w43WmCzrOHShlEU+zw="; | 148 | } |
| 149 | } | 149 | ]; |
| 150 | ]; | ||
| 151 | }; | ||
| 152 | |||
| 153 | # epistemia | ||
| 154 | wg1 = { | ||
| 155 | ips = [ | ||
| 156 | "10.0.13.2/24" | ||
| 157 | "fd00:b0ba:cafe:babe::2/64" | ||
| 158 | ]; | ||
| 159 | privateKeyFile = config.age.secrets.wg1_demiurge.path; | ||
| 160 | listenPort = 51820; | ||
| 161 | fwMark = "51821"; | ||
| 162 | mtu = 1420; | ||
| 163 | |||
| 164 | #table = "Off"; | ||
| 165 | postSetup = '' | ||
| 166 | ip rule add from 10.0.13.0/24 lookup main pref 31000 | ||
| 167 | ip rule add from all fwmark 51821 lookup 51821 pref 32000 | ||
| 168 | ip route replace default via 192.168.1.1 dev eth0 table 51821 | ||
| 169 | |||
| 170 | # NAT iphonebob and allow traffic between peers (when routing through demiurge) | ||
| 171 | ${pkgs.iptables}/bin/iptables -F FORWARD | ||
| 172 | ${pkgs.iptables}/bin/iptables -t nat -I POSTROUTING 1 -s 10.0.13.4/32 -o wg0 -j MASQUERADE | ||
| 173 | ${pkgs.iptables}/bin/iptables -A FORWARD -i wg1 -o wg1 -j ACCEPT | ||
| 174 | ${pkgs.iptables}/bin/iptables -A FORWARD -i wg1 -o wg0 -j ACCEPT | ||
| 175 | ${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -o wg1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
| 176 | ''; | ||
| 177 | preShutdown = '' | ||
| 178 | ip rule del from all fwmark 51821 lookup 51821 pref 32000 | ||
| 179 | ip rule del from 10.0.13.0/24 lookup main pref 31000 | ||
| 180 | ip route flush table 51821 | ||
| 181 | |||
| 182 | ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.0.13.4/32 -o wg0 -j MASQUERADE | ||
| 183 | ${pkgs.iptables}/bin/iptables -F FORWARD | ||
| 184 | ''; | ||
| 185 | |||
| 186 | peers = [ | ||
| 187 | # saklas | ||
| 188 | { | ||
| 189 | allowedIPs = [ | ||
| 190 | "10.0.13.1/32" | ||
| 191 | "fd00:b0ba:cafe:babe::1/128" | ||
| 192 | ]; | ||
| 193 | endpoint = "157.180.125.215:51820"; | ||
| 194 | persistentKeepalive = 25; | ||
| 195 | publicKey = "XvRailvccuc7LJIF4aaYM/MLkU4upiprwFlCfBllhl0="; | ||
| 196 | } | ||
| 197 | # hastur | ||
| 198 | { | ||
| 199 | allowedIPs = [ | ||
| 200 | "10.0.13.3/32" | ||
| 201 | "fd00:b0ba:cafe:babe::3/128" | ||
| 202 | ]; | ||
| 203 | persistentKeepalive = 25; | ||
| 204 | publicKey = "MOmRjVbRuWEuK0oHQ+C0jTaceCUPd2fpzDbh8ue6bDc="; | ||
| 205 | } | ||
| 206 | # iphonebob | ||
| 207 | { | ||
| 208 | allowedIPs = [ | ||
| 209 | "10.0.13.4/32" | ||
| 210 | "fd00:b0ba:cafe:babe::4/128" | ||
| 211 | ]; | ||
| 212 | persistentKeepalive = 25; | ||
| 213 | publicKey = "Xn0EmeRZdpMejBgzr98mYtb/2f5O58GAzQLNZV/SS30="; | ||
| 214 | } | ||
| 215 | # lab | ||
| 216 | { | ||
| 217 | allowedIPs = [ | ||
| 218 | "10.0.13.5/32" | ||
| 219 | "fd00:b0ba:cafe:babe::5/128" | ||
| 220 | ]; | ||
| 221 | persistentKeepalive = 25; | ||
| 222 | publicKey = "iMDEwvXjPAlQH8ZCmP63FM5ICYIFIX5XIyGxjnXoNVE="; | ||
| 223 | } | ||
| 224 | ]; | ||
| 225 | }; | ||
| 226 | }; | 150 | }; |
| 227 | }; | 151 | }; |
| 228 | 152 | ||
| @@ -390,6 +314,19 @@ | |||
| 390 | }; | 314 | }; |
| 391 | }; | 315 | }; |
| 392 | 316 | ||
| 317 | # vpn | ||
| 318 | tailscale = { | ||
| 319 | enable = true; | ||
| 320 | authKeyFile = config.age.secrets.tailscale_demiurge.path; | ||
| 321 | disableTaildrop = true; | ||
| 322 | disableUpstreamLogging = true; | ||
| 323 | extraSetFlags = [ "--advertise-exit-node" ]; | ||
| 324 | #extraUpFlags = [ "--login-server=https://headscale.13f0.net" ]; | ||
| 325 | extraUpFlags = [ "--login-server=https://controlplane.tailscale.com" ]; | ||
| 326 | openFirewall = true; | ||
| 327 | useRoutingFeatures = "both"; | ||
| 328 | }; | ||
| 329 | |||
| 393 | # automatically scrub zfs pools (every week by default) | 330 | # automatically scrub zfs pools (every week by default) |
| 394 | zfs.autoScrub.enable = true; | 331 | zfs.autoScrub.enable = true; |
| 395 | 332 | ||
| @@ -1154,21 +1091,10 @@ | |||
| 1154 | 1091 | ||
| 1155 | # extra systemd stuff | 1092 | # extra systemd stuff |
| 1156 | systemd.services = { | 1093 | systemd.services = { |
| 1157 | nginx = { | 1094 | #nginx = { |
| 1158 | after = [ "wireguard-wg1.service" ]; | 1095 | # after = [ "wireguard-wg1.service" ]; |
| 1159 | requires = [ "wireguard-wg1.service" ]; | 1096 | # serviceConfig.Type = lib.mkForce "idle"; |
| 1160 | serviceConfig.Type = lib.mkForce "idle"; | 1097 | #}; |
| 1161 | }; | ||
| 1162 | |||
| 1163 | wireguard-wg0 = { | ||
| 1164 | after = [ "network-addresses-eth0.service" ]; | ||
| 1165 | requires = [ "network-addresses-eth0.service" ]; | ||
| 1166 | }; | ||
| 1167 | |||
| 1168 | wireguard-wg1 = { | ||
| 1169 | after = [ "wireguard-wg0.service" ]; | ||
| 1170 | requires = [ "wireguard-wg0.service" ]; | ||
| 1171 | }; | ||
| 1172 | }; | 1098 | }; |
| 1173 | 1099 | ||
| 1174 | # create caches and use mandoc | 1100 | # create caches and use mandoc |
diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 0d46c6d..4bfeab9 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix | |||
| @@ -20,8 +20,9 @@ in | |||
| 20 | 20 | ||
| 21 | "wg0_demiurge.age".publicKeys = users ++ [ demiurge ]; | 21 | "wg0_demiurge.age".publicKeys = users ++ [ demiurge ]; |
| 22 | "wg0_hastur.age".publicKeys = users ++ [ hastur ]; | 22 | "wg0_hastur.age".publicKeys = users ++ [ hastur ]; |
| 23 | "wg1_demiurge.age".publicKeys = users ++ [ demiurge ]; | 23 | "tailscale_demiurge.age".publicKeys = users ++ [ demiurge ]; |
| 24 | "wg1_hastur.age".publicKeys = users ++ [ hastur ]; | 24 | "tailscale_hastur.age".publicKeys = users ++ [ hastur ]; |
| 25 | "tailscale_saklas.age".publicKeys = users ++ [ saklas ]; | ||
| 25 | 26 | ||
| 26 | "wpa_supplicant.age".publicKeys = users ++ [ hastur ]; | 27 | "wpa_supplicant.age".publicKeys = users ++ [ hastur ]; |
| 27 | } | 28 | } |
diff --git a/secrets/tailscale_demiurge.age b/secrets/tailscale_demiurge.age new file mode 100644 index 0000000..a855cf0 --- /dev/null +++ b/secrets/tailscale_demiurge.age | |||
| Binary files differ | |||
diff --git a/secrets/tailscale_hastur.age b/secrets/tailscale_hastur.age new file mode 100644 index 0000000..420e7c8 --- /dev/null +++ b/secrets/tailscale_hastur.age | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | age-encryption.org/v1 | ||
| 2 | -> ssh-ed25519 AaF/mQ ZhtqaDNCYfckXuWoIPlmf6VMSZIbEoKROUTVsC3QJ2w | ||
| 3 | bQVjId8jiQXIUarsPUYwLEGof4W4b2gEOnL6ndd7hB8 | ||
| 4 | -> ssh-ed25519 CQpZUw f3XFvZLovkTydK2odqGU0UZd58s273diGLtku4uLSzQ | ||
| 5 | puBoVJ9Cb+m00M1UivQBD2NbxB9QJgeg0W+tv49WW2I | ||
| 6 | --- /4rFWR1tyCNnBgRlmH6Yku2GQwASTJ4GQbyQii0TZAo | ||
| 7 | E,;l&L/@q.x8(,hӾ_їY;aˌh`Zn(D5T ͒,فrr:SzkjG \ No newline at end of file | ||
diff --git a/secrets/tailscale_saklas.age b/secrets/tailscale_saklas.age new file mode 100644 index 0000000..b654cbc --- /dev/null +++ b/secrets/tailscale_saklas.age | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | age-encryption.org/v1 | ||
| 2 | -> ssh-ed25519 AaF/mQ CFompU5/+edOgTq43LDiW2D1QfWrOCDraA81AwkBfGM | ||
| 3 | IxCXSQGTxY5XudpDZsszmRv6PTMwsuGjO926gABKfIY | ||
| 4 | -> ssh-ed25519 hc2ELA LitSyMM/w8BfhK6KlXu3Vcyc8nw1gMPHnXgnaWB1tDc | ||
| 5 | lw5E5c5eoPj5H4kdg3P23LTY+Rp3tdfui8vchHwN8Y0 | ||
| 6 | --- JjsrCNKCL69/V8ullEAbaYmCxmP3LSnjl6BT0HnWZV4 | ||
| 7 | tpM^/BPhH"WP#m/ƶږ 1 | ||
| 8 | 8dHޝQMhA "#m fśф}FCyH \ No newline at end of file | ||
