This repository has no description
6.6 kB
194 lines
1{
2 self,
3 config,
4 lib,
5 ...
6}:
7
8{
9 imports = [
10 ../../2configs
11 ../../2configs/ssh-redirect.nix
12 ../../2configs/retiolum.nix
13 ../../2configs/mailserver.nix
14 ../../2configs/snappymail.nix
15 ../../2configs/gsm-wiki.nix
16 ../../2configs/monitoring/telegraf.nix
17 ../../2configs/pair-programming.nix
18 ../../2configs/nginx.nix
19 ../../2configs/rogue-talk.nix
20
21 ../../2configs/services/matrix
22 ../../2configs/services/matrix/proxy.nix
23 ../../2configs/services/matrix/cinny.nix
24 ../../2configs/services/matrix/bridges/mautrix-whatsapp.nix
25 ../../2configs/services/matrix/bridges/mautrix-signal.nix
26 ../../2configs/services/matrix/bridges/heisenbridge.nix
27 ../../2configs/services/matrix/bridges/mautrix-telegram.nix
28 ../../2configs/services/matrix/bridges/mautrix-discord.nix
29 ../../2configs/services/matrix/bridges/matrix-zulip-bridge.nix
30
31 ../../2configs/services/pad
32
33 ../../2configs/hass/proxy.nix
34
35 # sync-containers
36 ../../2configs/consul.nix
37 ../../2configs/services/flix/container-host.nix
38 ../../2configs/services/radio/container-host.nix
39 ../../2configs/orange-host.nix
40 ../../2configs/hotdog-host.nix
41
42 # other containers
43 ../../2configs/riot.nix
44
45 # proxying of services
46 ../../2configs/services/radio/proxy.nix
47 ../../2configs/services/flix/proxy.nix
48 ../../2configs/services/coms/jitsi.nix
49 # mastodon (social.krebsco.de) -> hotdog container, migrated from prism
50 (self.inputs.stockholm + "/krebs/2configs/mastodon-proxy.nix")
51
52 # dns
53 ../../2configs/dns/knot.nix
54
55 # url shortener
56 ../../2configs/go.nix
57
58 # video strreaming
59 ../../2configs/cast.nix
60
61 # c-base ollama tunnel
62 ../../2configs/c-base-ai-tunnel.nix
63
64 # debug stuff
65 ../../2configs/websites/mergebot.lassul.us.nix
66
67 # autoupdates
68 ../../2configs/autoupdate.nix
69
70 # vaultwarden
71 ../../2configs/vaultwarden.nix
72
73 # download user
74 ../../2configs/download-user.nix
75
76 # caldav calendar
77 ../../2configs/radicale.nix
78
79 # lassul.us website
80 ../../2configs/websites/lassulus.nix
81
82 # realwallpaper generator
83 ../../2configs/realwallpaper.nix
84
85 # binaergewitter announce bot
86 # ../../2configs/bgt-bot
87
88 # paste + cyberlocker
89 ../../2configs/paste.nix
90
91 # opencrow matrix bot
92 ../../2configs/opencrow.nix
93
94 # document signing
95 ../../2configs/docuseal.nix
96
97 # kannix (kanban board)
98 ../../2configs/kannix.nix
99
100 # backups
101 ./backup.nix
102
103 # IPFS
104 ../../2configs/services/flix/ipfs.nix
105
106 # n2n supernode (n2n.lassul.us)
107 ../../2configs/n2n-supernode.nix
108
109 # pocket-id SSO IdP (id.lassul.us)
110 ../../2configs/pocket-id.nix
111
112 # covibe co-vibing dashboard (covibe.lassul.us)
113 ../../2configs/covibe.nix
114
115 # omnigent agent meta-harness (omni.lassul.us)
116 ../../2configs/omnigent.nix
117
118 # radicle public seed (radicle.lassul.us)
119 ../../2configs/radicle.lassul.us.nix
120 # radicle identity + node for this machine (/var/lib/rad)
121 ../../2configs/rad.nix
122
123 # self-hosted iroh relay (relay.lassul.us)
124 ../../2configs/iroh-relay
125
126 # signed remote command execution (root executor + fleet dashboard,
127 # sigexec.lassul.us)
128 ../../2configs/sigexec/executor.nix
129 ../../2configs/sigexec/dashboard.nix
130 ];
131
132 # lassul.us shouldn't be the default vhost here (nginx.nix already sets one)
133 services.nginx.virtualHosts."lassul.us" = {
134 default = lib.mkForce false;
135 locations = {
136 "= /wallpaper-marker.png".extraConfig = ''
137 alias /var/realwallpaper/realwallpaper-marker.png;
138 '';
139 "= /wallpaper.png".extraConfig = ''
140 alias /var/realwallpaper/realwallpaper.png;
141 '';
142 "= /wallpaper-stars-berlin.png".extraConfig = ''
143 alias /var/realwallpaper/realwallpaper-krebs-stars-berlin.png;
144 '';
145 };
146 };
147
148 # riot VM (HFOS): fresh libvirt guest on a dedicated bridged public IP.
149 # Bridged onto ext-br with its own Hetzner MAC, so libvirt manages no
150 # iptables for it -> no nat-chain race, no restart-iptables hack (cf. hfos.nix).
151 virtualisation.libvirtd.enable = true;
152 security.polkit.enable = true;
153 users.users.riot = {
154 isNormalUser = true;
155 extraGroups = [ "libvirtd" ];
156 openssh.authorizedKeys.keys = [
157 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwcI8EKqUwYVd4IlnTTaNY3qVMDe2M1sVPMdWaTJ8FnAXixBcZozFHyJ9bvGn6c/vFGBEACZk6QCxC2+sTxbaodCOUIyhAtxqAGO7jINmGrVWjg2NW8qBi+e+ekr2+jlhizxgMPgMcbawuazpMzrozi6sfJfRelJRqe6TxrK/SBO+V5pf8v2ubAfHHF6bJrqAykC247d2NmsHEyM/nGOOb2AlJx2vrK1FbFWr2fBAvnhJww9wqrfDYSM6+oRF/vrYKkT9cU8yjtCkyaJZTqRufF2pzc9a0X3Z4LHEIUykAl2aVmi5Wzh8CZj3qCeVb9Ju0ZGQIa5pvG5CbH5SUJOr9y6zhTx1xbqL+JYGkJqgHPMOCFiNIvWnFaNlnvFf4C9KcTf/VMOEvNdDklpjoWm+ptuQIciAhWKuUHd/6MqaRjmlvUqjl49EkRvYOGn9vasKt66MYrtfvbZ3tcqh5w9EEKhrcygiUXhIJzhu2s1BseAVRLjCsQ24BNbzrYiCO+vuk8/hdeHB1rP6Sas2v7jvYb3zQd647OTq+HrZWN8aCjCs5h8Y0QxrQzsLru0zKDRaNDlbSshNBAw7PzSXQAf9fISH7v6sC4nstf5jk+87ua/7xjWG4NYp5Y9FMFCsuE3XVmUCAbauq18RmN6V4s2TxCEs9bxONO0Vba4zwPnvMlw== cardno:000619250765"
158 ];
159 };
160 # the only forwarding the VM needs: accept traffic to/from its public IP.
161 krebs.iptables.tables.filter.FORWARD.rules = lib.mkBefore [
162 {
163 v6 = false;
164 predicate = "--destination 95.217.192.52";
165 target = "ACCEPT";
166 }
167 {
168 v6 = false;
169 predicate = "--source 95.217.192.52";
170 target = "ACCEPT";
171 }
172 ];
173
174 # tank/radicle (radicle seed storage) is created by disko at install; on an
175 # already-provisioned host it must be created before deploying:
176 # zfs create -o mountpoint=/var/lib/radicle -o quota=80G tank/radicle
177 # nofail keeps a missing dataset from failing local-fs.target -> emergency
178 # mode (which has no network and bricks the box).
179 fileSystems."/var/lib/radicle".options = [ "nofail" ];
180
181 # Fleet-wide safety net: this box is headless (Hetzner, console only via
182 # KVM), so a failed critical target must never strand us at the emergency
183 # shell. With emergency mode disabled systemd keeps booting instead of
184 # dropping to a console -> network + sshd still come up, so a bad deploy
185 # (e.g. a missing dataset, as happened once) leaves the box reachable to
186 # fix and redeploy rather than bricked. Mirrors nixpkgs' headless profile.
187 # Note: we intentionally do NOT auto-roll-back to the previous generation;
188 # our config is pulled from git by system.autoUpgrade, so a rollback would
189 # just re-pull the same broken config on the next run (a rollback loop).
190 systemd.enableEmergencyMode = false;
191
192 krebs.build.host = config.krebs.hosts.neoprism;
193 system.stateVersion = "24.05";
194}