This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / nixos / machines / prism / config.nix
18 kB 418 lines
1{ self, config, lib, pkgs, ... }: let 2 slib = self.inputs.stockholm.lib; 3in { 4 imports = [ 5 ./backup.nix 6 ../../. 7 ../../2configs/retiolum.nix 8 ../../2configs/libvirt.nix 9 ../../2configs/websites/lassulus.nix 10 ../../2configs/services/git/proxy.nix 11 ../../2configs/monitoring/telegraf.nix 12 ../../2configs/consul.nix 13 { 14 services.nginx.enable = true; 15 imports = [ 16 ../../2configs/websites/domsen.nix 17 ]; 18 # needed by domsen.nix ^^ 19 lass.usershadow = { 20 enable = true; 21 }; 22 23 krebs.iptables.tables.filter.INPUT.rules = [ 24 { predicate = "-p tcp --dport http"; target = "ACCEPT"; } 25 { predicate = "-p tcp --dport https"; target = "ACCEPT"; } 26 ]; 27 } 28 { # TODO make new hfos.nix out of this vv 29 users.users.riot = { 30 uid = slib.genid_uint31 "riot"; 31 isNormalUser = true; 32 extraGroups = [ "libvirtd" ]; 33 openssh.authorizedKeys.keys = [ 34 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6o6sdTu/CX1LW2Ff5bNDqGEAGwAsjf0iIe5DCdC7YikCct+7x4LTXxY+nDlPMeGcOF88X9/qFwdyh+9E4g0nUAZaeL14Uc14QDqDt/aiKjIXXTepxE/i4JD9YbTqStAnA/HYAExU15yqgUdj2dnHu7OZcGxk0ZR1OY18yclXq7Rq0Fd3pN3lPP1T4QHM9w66r83yJdFV9szvu5ral3/QuxQnCNohTkR6LoJ4Ny2RbMPTRtb+jPbTQYTWUWwV69mB8ot5nRTP4MRM9pu7vnoPF4I2S5DvSnx4C5zdKzsb7zmIvD4AmptZLrXj4UXUf00Xf7Js5W100Ne2yhYyhq+35 riot@lagrange" 35 ]; 36 }; 37 krebs.iptables.tables.filter.FORWARD.rules = lib.mkBefore [ 38 { v6 = false; predicate = "--destination 95.216.1.130"; target = "ACCEPT"; } 39 { v6 = false; predicate = "--source 95.216.1.130"; target = "ACCEPT"; } 40 ]; 41 } 42 { 43 users.users.tv = { 44 uid = slib.genid_uint31 "tv"; 45 isNormalUser = true; 46 openssh.authorizedKeys.keys = [ 47 config.krebs.users.tv.pubkey 48 ]; 49 }; 50 users.users.makefu = { 51 uid = slib.genid_uint31 "makefu"; 52 isNormalUser = true; 53 openssh.authorizedKeys.keys = [ 54 config.krebs.users.makefu.pubkey 55 ]; 56 }; 57 users.extraUsers.dritter = { 58 uid = slib.genid_uint31 "dritter"; 59 isNormalUser = true; 60 extraGroups = [ 61 "download" 62 ]; 63 openssh.authorizedKeys.keys = [ 64 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDnqOWDDk7QkSAvrSLkEoz7dY22+xPyv5JDn2zlfUndfavmTMfZvPx9REMjgULbcCSM4m3Ncf40yUjciDpVleGoEz82+p/ObHAkVWPQyXRS3ZRM2IJJultBHEFc61+61Pi8k3p5pBhPPaig6VncJ4uUuuNqen9jqLesSTVXNtdntU2IvnC8B8k1Kq6fu9q1T2yEOMxkD31D5hVHlqAly0LdRiYvtsRIoCSmRvlpGl70uvPprhQxhtoiEUeDqmIL7BG9x7gU0Swdl7R0/HtFXlFuOwSlNYDmOf/Zrb1jhOpj4AlCliGUkM0iKIJhgH0tnJna6kfkGKHDwuzITGIh6SpZ dritter@Janeway" 65 ]; 66 }; 67 users.extraUsers.juhulian = { 68 uid = 1339; 69 isNormalUser = true; 70 openssh.authorizedKeys.keys = [ 71 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBQhLGvfv4hyQ/nqJGy1YgHXPSVl6igeWTroJSvAhUFgoh+rG+zvqY0EahKXNb3sq0/OYDCTJVuucc0hgCg7T2KqTqMtTb9EEkRmCFbD7F7DWZojCrh/an6sHneqT5eFvzAPZ8E5hup7oVQnj5P5M3I9keRHBWt1rq6q0IcOEhsFvne4qJc73aLASTJkxzlo5U8ju3JQOl6474ECuSn0lb1fTrQ/SR1NgF7jV11eBldkS8SHEB+2GXjn4Yrn+QUKOnDp+B85vZmVlJSI+7XR1/U/xIbtAjGTEmNwB6cTbBv9NCG9jloDDOZG4ZvzzHYrlBXjaigtQh2/4mrHoKa5eV juhulian@juhulian" 72 ]; 73 }; 74 users.users.hellrazor = { 75 uid = slib.genid_uint31 "hellrazor"; 76 isNormalUser = true; 77 extraGroups = [ 78 "download" 79 ]; 80 openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDQFaYOWRUvHP6I37q9Dd4PJOq8FNQqAeJZ8pLx0G62uC450kbPGcG80rHHvXmk7HqQP6biJmMg48bOsvXAScPot2Qhp1Qc35CuUqVhLiTvUAsi8l/iJjhjZ23yRGDCAmW5+JIOzIvECkcbMnG7YoYAQ9trNGHe9qwGzQGhpt3QVClE23WtE3PVKRLQx1VbiabSnAm6tXVd2zpUoSdpWt8Gpi2taM4XXJ5+l744MNxFHvDapN5xqpYzwrA34Ii13jNLWcGbtgxESpR+VjnamdWByrkBsW4X5/xn2K1I1FrujaM/DBHV1QMaDKst9V8+uL5X7aYNt0OUBu2eyZdg6aujY2BYovB9uRyR1JIuSbA/a54MM96yN9WirMUufJF/YZrV0L631t9EW8ORyWUo1GRzMuBHVHQlfApj7NCU/jEddUuTqKgwyRgTmMFMUI4M0tRULAB/7pBE1Vbcx9tg6RsKIk8VkskfbBJW9Y6Sx6YoFlxPdgMNIrBefqEjIV62piP7YLMlvfIDCJ7TNd9dLN86XGggZ/nD5zt6SL1o61vVnw9If8pHosppxADPJsJvcdN6fOe16/tFAeE0JRo0jTcyFVTBGfhpey+rFfuW8wtUyuO5WPUxkOn7xMHGMWHJAtWX2vwVIDtLxvqn48B4SmEOpPD6ii+vcpwqAex3ycqBUQ==" ]; 81 }; 82 } 83 { 84 services.nginx.virtualHosts."radio.lassul.us" = { 85 enableACME = true; 86 addSSL = true; 87 locations."/" = { 88 # recommendedProxySettings = true; 89 proxyWebsockets = true; 90 proxyPass = "http://radio.r"; 91 extraConfig = '' 92 proxy_set_header Host radio.r; 93 # get source ip for weather reports 94 proxy_set_header user-agent "$http_user_agent; client-ip=$remote_addr"; 95 ''; 96 }; 97 }; 98 krebs.htgen.radio-redirect = { 99 port = 8000; 100 scriptFile = pkgs.writers.writeDash "redir" '' 101 printf 'HTTP/1.1 301 Moved Permanently\r\n' 102 printf "Location: http://radio.lassul.us''${Request_URI}\r\n" 103 printf '\r\n' 104 ''; 105 }; 106 krebs.iptables.tables.filter.INPUT.rules = [ 107 { predicate = "-p tcp --dport 8000"; target = "ACCEPT"; } 108 ]; 109 } 110 ../../2configs/exim-smarthost.nix 111 ../../2configs/privoxy-retiolum.nix 112 ../../2configs/binary-cache/server.nix 113 ../../2configs/binary-cache/proxy.nix 114 ../../2configs/iodined.nix 115 ../../2configs/paste.nix 116 ../../2configs/syncthing.nix 117 ../../2configs/reaktor-coders.nix 118 ../../2configs/container-networking.nix 119 ../../2configs/fysiirc.nix 120 ../../2configs/bgt-bot 121 ../../2configs/matrix.nix 122 (self.inputs.stockholm + "/krebs/2configs/mastodon-proxy.nix") 123 { 124 services.tor = { 125 enable = true; 126 }; 127 } 128 { 129 imports = [ 130 ../../2configs/realwallpaper.nix 131 ]; 132 services.nginx.virtualHosts."lassul.us".locations = { 133 "= /wallpaper-marker.png".extraConfig = '' 134 alias /var/realwallpaper/realwallpaper-marker.png; 135 ''; 136 "= /wallpaper.png".extraConfig = '' 137 alias /var/realwallpaper/realwallpaper.png; 138 ''; 139 "= /wallpaper-stars-berlin.png".extraConfig = '' 140 alias /var/realwallpaper/realwallpaper-krebs-stars-berlin.png; 141 ''; 142 }; 143 } 144 ../../2configs/minecraft.nix 145 ../../2configs/codimd.nix 146 ../../2configs/go.nix 147 { 148 lass.nichtparasoup.enable = true; 149 services.nginx = { 150 enable = true; 151 virtualHosts."lol.lassul.us" = { 152 forceSSL = true; 153 enableACME = true; 154 locations."/".extraConfig = '' 155 proxy_pass http://localhost:5001; 156 ''; 157 }; 158 }; 159 } 160 { 161 imports = [ 162 ../../2configs/wiregrill.nix 163 ]; 164 krebs.iptables.tables.nat.PREROUTING.rules = lib.mkOrder 999 [ 165 { v6 = false; predicate = "-s 10.244.0.0/16"; target = "ACCEPT"; } 166 { v4 = false; predicate = "-s 42:1::/32"; target = "ACCEPT"; } 167 ]; 168 krebs.iptables.tables.filter.FORWARD.rules = lib.mkBefore [ 169 { predicate = "-i wiregrill -o retiolum"; target = "ACCEPT"; } 170 { predicate = "-i retiolum -o wiregrill"; target = "ACCEPT"; } 171 ]; 172 krebs.iptables.tables.nat.POSTROUTING.rules = [ 173 { v4 = false; predicate = "-s 42:1::/32 ! -d 42:1::/48"; target = "MASQUERADE"; } 174 { v6 = false; predicate = "-s 10.244.0.0/16 ! -d 10.244.0.0/16"; target = "MASQUERADE"; } 175 ]; 176 services.dnsmasq = { 177 enable = true; 178 resolveLocalQueries = false; 179 180 extraConfig= '' 181 bind-interfaces 182 interface=wiregrill 183 interface=retiolum 184 ''; 185 }; 186 } 187 { 188 krebs.iptables.tables.filter.INPUT.rules = [ 189 { predicate = "-p udp --dport 60000:61000"; target = "ACCEPT"; } 190 ]; 191 } 192 ../../2configs/services/coms/jitsi.nix 193 ../../2configs/services/coms/murmur.nix 194 { 195 196 services.nginx.virtualHosts."flix.lassul.us" = { 197 forceSSL = true; 198 enableACME = true; 199 locations."/" = { 200 proxyPass = "http://yellow.r:8096"; 201 proxyWebsockets = true; 202 recommendedProxySettings = true; 203 }; 204 }; 205 services.nginx.virtualHosts."flex.lassul.us" = { 206 forceSSL = true; 207 enableACME = true; 208 locations."/" = { 209 proxyPass = "http://radar.r:7878"; 210 proxyWebsockets = true; 211 recommendedProxySettings = true; 212 extraConfig = '' 213 auth_basic "Restricted Content"; 214 auth_basic_user_file ${pkgs.writeText "flix-user-pass" '' 215 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0 216 ''}; 217 ''; 218 }; 219 }; 220 services.nginx.virtualHosts."flux.lassul.us" = { 221 forceSSL = true; 222 enableACME = true; 223 locations."/" = { 224 proxyPass = "http://sonar.r:8989"; 225 proxyWebsockets = true; 226 recommendedProxySettings = true; 227 extraConfig = '' 228 auth_basic "Restricted Content"; 229 auth_basic_user_file ${pkgs.writeText "flix-user-pass" '' 230 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0 231 ''}; 232 ''; 233 }; 234 }; 235 services.nginx.virtualHosts."lassul.us" = { 236 locations."^~ /flix/".extraConfig = '' 237 if ($scheme != "https") { 238 rewrite ^ https://$host$request_uri permanent; 239 } 240 auth_basic "Restricted Content"; 241 auth_basic_user_file ${pkgs.writeText "flix-user-pass" '' 242 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0 243 ''}; 244 proxy_pass http://yellow.r:80/; 245 proxy_set_header Accept-Encoding ""; 246 sub_filter "https://lassul.us/" "https://lassul.us/flix/"; 247 sub_filter_once off; 248 ''; 249 locations."^~ /chatty/".extraConfig = '' 250 rewrite ^ https://$host/flix/$request_uri permanent; 251 ''; 252 #locations."^~ /transmission".return = "301 https://$host/transmission/web/"; 253 locations."^~ /transmission/".extraConfig = '' 254 if ($scheme != "https") { 255 rewrite ^ https://$host$request_uri permanent; 256 } 257 auth_basic "Restricted Content"; 258 auth_basic_user_file ${pkgs.writeText "transmission-user-pass" '' 259 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0 260 ''}; 261 proxy_pass_header X-Transmission-Session-Id; 262 proxy_pass http://10.233.2.14:9091; 263 ''; 264 }; 265 266 users.groups.download = {}; 267 users.users = { 268 download = { 269 createHome = false; 270 group = "download"; 271 name = "download"; 272 home = "/var/download"; 273 useDefaultShell = true; 274 uid = slib.genid "download"; 275 isSystemUser = true; 276 openssh.authorizedKeys.keys = with config.krebs.users; [ 277 lass.pubkey 278 lass-android.pubkey 279 makefu.pubkey 280 palo.pubkey 281 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDB0d0JA20V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i85G2xLpXu1A3921pseBTW6Q6kbYK9eqxAay2c/kNbwNqFnO+nCvQ6Ier/hvGddOtItMu96IuU2E7mPN6WgvM8/3fjJRFWnZxFxqu/k7iH+yYT8qwRgdiSqZc76qvkYEuabdk2itstTRY0A3SpI3hFMZDw/7bxgMZtqpfyoRk5s= philip@shiki11:15 <Profpatsch> AAAAB3NzaC1yc2EAAAADAQABAAABgQC4ECL9NSCWqs4KVe+FF+2BPtl5Bv5aQPHqnXllCyiESZykwRKLx6/AbF5SbUAUMVZtp9oDSdp28m3BvVeWJ/q7hAbIxUtfd/jp+JBRZ8Kj6K5GzUO7Bhgl/o0A7xEjAeOKHiYuLjdPMcFUyl6Ah4ey/mcQYf6AdU0+hYUDeUlKe/YxxYD6202W0GJq2xGdIqs/TbopT9iaX+sv0wdXDVfFY72nFqOUwJW3u6O2viKKRugrz/eo50Eo3ts7pYz/FpDXExrUvV9Vu/bQ34pa8nKgF3/AKQHgmzljNQSVZKyAV8OY0UFonjBMXCBg2tXtwfnlzdx2SyuQVv55x+0AuRKsi85G2xLpXu1A3921pseBTW6Q6kbYK9eqxAay2c/kNbwNqFnO+nCvQ6Ier/hvGddOtItMu96IuU2E7mPN6WgvM8/3fjJRFWnZxFxqu/k7iH+yYT8qwRgdiSqZc76qvkYEuabdk2itstTRY0A3SpI3hFMZDw/7bxgMZtqpfyoRk5s= philip@shiki" 283 mic92.pubkey 284 qubasa.pubkey 285 ]; 286 }; 287 }; 288 289 system.activationScripts.downloadFolder = '' 290 mkdir -p /var/download 291 chmod 775 /var/download 292 ln -fnsT /var/lib/containers/yellow/var/download/finished /var/download/finished || : 293 chown download: /var/download/finished 294 ''; 295 296 fileSystems."/export/download" = { 297 device = "/var/lib/containers/yellow/var/download/finished"; 298 options = [ "bind" ]; 299 }; 300 services.nfs.server = { 301 enable = true; 302 exports = '' 303 /export 42::/16(insecure,ro,crossmnt) 304 ''; 305 lockdPort = 4001; 306 mountdPort = 4002; 307 statdPort = 4000; 308 }; 309 310 services.samba = { 311 enable = true; 312 enableNmbd = false; 313 extraConfig = '' 314 workgroup = WORKGROUP 315 netbios name = PRISM 316 server string = ${config.networking.hostName} 317 # only allow retiolum addresses 318 hosts allow = 42::/16 10.243.0.0/16 10.244.0.0/16 319 320 # Use sendfile() for performance gain 321 use sendfile = true 322 323 # No NetBIOS is needed 324 disable netbios = true 325 326 # Only mangle non-valid NTFS names, don't care about DOS support 327 mangled names = illegal 328 329 # Performance optimizations 330 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 331 332 # Disable all printing 333 load printers = false 334 disable spoolss = true 335 printcap name = /dev/null 336 337 map to guest = Bad User 338 max log size = 50 339 dns proxy = no 340 security = user 341 342 [global] 343 syslog only = yes 344 ''; 345 shares.public = { 346 comment = "Warez"; 347 path = "/export"; 348 public = "yes"; 349 "only guest" = "yes"; 350 "create mask" = "0644"; 351 "directory mask" = "2777"; 352 writable = "no"; 353 printable = "no"; 354 }; 355 }; 356 357 krebs.iptables.tables.filter.INPUT.rules = [ 358 # smbd 359 { predicate = "-i retiolum -p tcp --dport 445"; target = "ACCEPT"; } 360 { predicate = "-i retiolum -p tcp --dport 111"; target = "ACCEPT"; } 361 { predicate = "-i retiolum -p udp --dport 111"; target = "ACCEPT"; } 362 { predicate = "-i retiolum -p tcp --dport 2049"; target = "ACCEPT"; } 363 { predicate = "-i retiolum -p udp --dport 2049"; target = "ACCEPT"; } 364 { predicate = "-i retiolum -p tcp --dport 4000:4002"; target = "ACCEPT"; } 365 { predicate = "-i retiolum -p udp --dport 4000:4002"; target = "ACCEPT"; } 366 { predicate = "-i wiregrill -p tcp --dport 445"; target = "ACCEPT"; } 367 { predicate = "-i wiregrill -p tcp --dport 111"; target = "ACCEPT"; } 368 { predicate = "-i wiregrill -p udp --dport 111"; target = "ACCEPT"; } 369 { predicate = "-i wiregrill -p tcp --dport 2049"; target = "ACCEPT"; } 370 { predicate = "-i wiregrill -p udp --dport 2049"; target = "ACCEPT"; } 371 { predicate = "-i wiregrill -p tcp --dport 4000:4002"; target = "ACCEPT"; } 372 { predicate = "-i wiregrill -p udp --dport 4000:4002"; target = "ACCEPT"; } 373 ]; 374 } 375 { # acme fallback for neoprism migration 376 services.nginx.virtualHosts."lassul.us".acmeFallbackHost = "orange.r"; 377 services.nginx.virtualHosts."radio.lassul.us".acmeFallbackHost = "neoprism.r"; 378 services.nginx.virtualHosts."flix.lassul.us".acmeFallbackHost = "neoprism.r"; 379 services.nginx.virtualHosts."jitsi.lassul.us".acmeFallbackHost = "neoprism.r"; 380 services.nginx.virtualHosts."cgit.lassul.us".acmeFallbackHost = "orange.r"; 381 services.nginx.virtualHosts."mail.lassul.us".acmeFallbackHost = "neoprism.r"; 382 services.nginx.virtualHosts."mumble.lassul.us".acmeFallbackHost = "neoprism.r"; 383 services.nginx.virtualHosts."mail.ubikmedia.eu" = { 384 enableACME = true; 385 forceSSL = true; 386 acmeFallbackHost = "ubik.r"; 387 locations."/" = { 388 recommendedProxySettings = true; 389 proxyWebsockets = true; 390 proxyPass = "https://ubik.r"; 391 }; 392 }; 393 } 394 ]; 395 396 krebs.build.host = config.krebs.hosts.prism; 397 services.earlyoom = { 398 enable = true; 399 freeMemThreshold = 5; 400 }; 401 402 # test stable-confusion external access 403 services.nginx.virtualHosts."testing.lassul.us" = { 404 forceSSL = true; 405 enableACME = true; 406 locations."/".extraConfig = '' 407 auth_basic "Restricted Content"; 408 auth_basic_user_file ${pkgs.writeText "flix-user-pass" '' 409 krebs:$apr1$1Fwt/4T0$YwcUn3OBmtmsGiEPlYWyq0 410 ''}; 411 proxy_pass http://stable-confusion.r:80/; 412 proxy_http_version 1.1; 413 proxy_set_header Upgrade $http_upgrade; 414 proxy_set_header Connection "Upgrade"; 415 proxy_set_header Accept-Encoding ""; 416 ''; 417 }; 418}