1
0

Compare commits

..

280 Commits

Author SHA1 Message Date
Flake Update Bot
7621ec1ae8 Update from updated-inputs-2025-11-15-02-03 2025-11-15 03:04:23 +01:00
Flake Update Bot
7542dfc205 Update nixpkgs 2025-11-15-02-03 2025-11-15 03:04:21 +01:00
Flake Update Bot
c8e2fdb9a4 Update from updated-inputs-2025-11-13-02-03 2025-11-13 03:04:14 +01:00
Flake Update Bot
75505fcb09 Update nixpkgs 2025-11-13-02-03 2025-11-13 03:04:12 +01:00
Flake Update Bot
134294645d Update from updated-inputs-2025-11-10-02-03 2025-11-10 03:04:12 +01:00
Flake Update Bot
38c63a6798 Update nixpkgs 2025-11-10-02-03 2025-11-10 03:04:09 +01:00
Flake Update Bot
b0f0082045 Update from updated-inputs-2025-11-09-02-03 2025-11-09 03:03:14 +01:00
Flake Update Bot
3bcc841a99 Update nixpkgs 2025-11-09-02-03 2025-11-09 03:03:11 +01:00
db9ea1ea5c flake.lock: Update nixpkgs and lix 2025-11-08 12:40:53 +01:00
Flake Update Bot
a598fb155d Update from updated-inputs-2025-11-07-02-03 2025-11-07 03:04:16 +01:00
Flake Update Bot
6918c86514 Update nixpkgs 2025-11-07-02-03 2025-11-07 03:04:14 +01:00
930be1c50c monitoring/targets.json: Add reichart.uber.space to monitoring 2025-11-06 20:54:52 +01:00
Flake Update Bot
1d24a95012 Update from updated-inputs-2025-11-04-02-03 2025-11-04 03:04:23 +01:00
Flake Update Bot
2a2ab641cc Update nixpkgs 2025-11-04-02-03 2025-11-04 03:04:21 +01:00
Flake Update Bot
a7255e6741 Update from updated-inputs-2025-11-02-02-03 2025-11-02 03:04:19 +01:00
Flake Update Bot
ee4b6d9f7a Update nixpkgs 2025-11-02-02-03 2025-11-02 03:04:16 +01:00
Flake Update Bot
54e24fe9cd Update from updated-inputs-2025-10-30-02-03 2025-10-30 03:04:16 +01:00
Flake Update Bot
b6063709b2 Update nixpkgs 2025-10-30-02-03 2025-10-30 03:04:14 +01:00
Flake Update Bot
220551d0e1 Update from updated-inputs-2025-10-28-02-03 2025-10-28 03:03:20 +01:00
Flake Update Bot
9cd78ef9c3 Update nixpkgs 2025-10-28-02-03 2025-10-28 03:03:19 +01:00
f3629c2653 profiles/ds-lite: Connect to Netcologne with PPP DS-Lite 2025-10-27 21:26:28 +01:00
Flake Update Bot
fcfd800f4f Update from updated-inputs-2025-10-27-02-03 2025-10-27 03:04:10 +01:00
Flake Update Bot
3d35434c9f Update nixpkgs 2025-10-27-02-03 2025-10-27 03:04:08 +01:00
Flake Update Bot
b1ad97cb41 Update from updated-inputs-2025-10-25-01-03 2025-10-25 03:03:21 +02:00
Flake Update Bot
852ea7aeb6 Update nixpkgs 2025-10-25-01-03 2025-10-25 03:03:19 +02:00
44afbff445 hosts/carbon: Change DSL uplink to netcologne 2025-10-24 21:36:41 +02:00
92817fdcad hosts/clerie-backup: Export metrics for backup replication to Hetzner 2025-10-24 18:13:24 +02:00
Flake Update Bot
40fa17c68e Update from updated-inputs-2025-10-23-01-03 2025-10-23 03:04:22 +02:00
Flake Update Bot
2e55530629 Update nixpkgs 2025-10-23-01-03 2025-10-23 03:04:20 +02:00
Flake Update Bot
38ec17d8d2 Update from updated-inputs-2025-10-20-01-03 2025-10-20 03:04:10 +02:00
Flake Update Bot
5205c22716 Update nixpkgs 2025-10-20-01-03 2025-10-20 03:04:07 +02:00
Flake Update Bot
a1e546b162 Update from updated-inputs-2025-10-16-01-03 2025-10-16 03:04:24 +02:00
Flake Update Bot
efd8b7bdd5 Update nixpkgs 2025-10-16-01-03 2025-10-16 03:04:22 +02:00
Flake Update Bot
ed0201606f Update from updated-inputs-2025-10-14-01-03 2025-10-14 03:04:17 +02:00
Flake Update Bot
7de94a1ef5 Update nixpkgs 2025-10-14-01-03 2025-10-14 03:04:15 +02:00
Flake Update Bot
c1b9eb0eef Update from updated-inputs-2025-10-11-01-03 2025-10-11 03:04:14 +02:00
Flake Update Bot
88a37194c0 Update nixpkgs 2025-10-11-01-03 2025-10-11 03:04:12 +02:00
Flake Update Bot
500f2b5034 Update from updated-inputs-2025-10-09-01-03 2025-10-09 03:04:18 +02:00
Flake Update Bot
294ebc570a Update nixpkgs 2025-10-09-01-03 2025-10-09 03:04:16 +02:00
Flake Update Bot
0a653f5212 Update from updated-inputs-2025-10-08-01-03 2025-10-08 03:04:23 +02:00
Flake Update Bot
ce606ddd76 Update nixpkgs 2025-10-08-01-03 2025-10-08 03:04:21 +02:00
e8cca7b1b6 pkgs/http.server: Add shortcut command for python3 http.server 2025-10-07 19:11:22 +02:00
Flake Update Bot
6a1d10a70b Update from updated-inputs-2025-10-03-01-03 2025-10-03 03:04:14 +02:00
Flake Update Bot
b7e754907d Update nixpkgs 2025-10-03-01-03 2025-10-03 03:04:12 +02:00
Flake Update Bot
adffed2de3 Update from updated-inputs-2025-09-30-01-03 2025-09-30 03:04:22 +02:00
Flake Update Bot
873328a837 Update nixpkgs 2025-09-30-01-03 2025-09-30 03:04:20 +02:00
Flake Update Bot
e435cf3591 Update from updated-inputs-2025-09-28-01-03 2025-09-28 03:03:14 +02:00
Flake Update Bot
1c253084d8 Update nixpkgs 2025-09-28-01-03 2025-09-28 03:03:12 +02:00
102509b9a8 hosts/krypton: Add tuba and flare apps 2025-09-27 18:43:16 +02:00
eaa4ee6d05 hosts/storage-2: Provide mixcloud directory listing as json too 2025-09-26 15:51:55 +02:00
Flake Update Bot
6404f24fb1 Update from updated-inputs-2025-09-26-01-03 2025-09-26 03:04:09 +02:00
Flake Update Bot
2c82edf9a1 Update nixpkgs 2025-09-26-01-03 2025-09-26 03:04:07 +02:00
Flake Update Bot
165cbf907b Update from updated-inputs-2025-09-24-01-03 2025-09-24 03:04:22 +02:00
Flake Update Bot
8103100380 Update nixpkgs 2025-09-24-01-03 2025-09-24 03:04:20 +02:00
Flake Update Bot
8aca087847 Update from updated-inputs-2025-09-22-01-03 2025-09-22 03:04:20 +02:00
Flake Update Bot
6015026d4f Update nixpkgs 2025-09-22-01-03 2025-09-22 03:04:17 +02:00
9659885079 pkgs/grow-last-partition-and-filesystem: Add missing dependency reference 2025-09-21 18:02:14 +02:00
50b575dcb3 hosts/storage-2: Convert em to mp3 2025-09-21 18:01:46 +02:00
165839be07 pkgs/convert-flac-dir-to-mp3: Use tmpfile for ffmpeg so we don't have broken files laying around 2025-09-21 17:18:08 +02:00
ce99bb114b pkgs/convert-flac-dir-to-mp3: Add script for coverting music libraries 2025-09-21 17:06:36 +02:00
23629e0662 pkgs/build-support: writePythonScript add runtimeInput option 2025-09-21 16:58:15 +02:00
6954e75a5c pkgs/grow-last-partition-and-filesystem: Automatically move GPT backup header to end of device 2025-09-21 14:36:04 +02:00
Flake Update Bot
052133edd3 Update from updated-inputs-2025-09-21-01-03 2025-09-21 03:04:24 +02:00
Flake Update Bot
b9d40f4645 Update nixpkgs 2025-09-21-01-03 2025-09-21 03:04:22 +02:00
Flake Update Bot
e6f41d13da Update from updated-inputs-2025-09-20-01-03 2025-09-20 03:04:21 +02:00
Flake Update Bot
88c5af2382 Update nixpkgs 2025-09-20-01-03 2025-09-20 03:04:19 +02:00
Flake Update Bot
16ddf5972b Update from updated-inputs-2025-09-19-01-03 2025-09-19 03:04:13 +02:00
Flake Update Bot
3d0229dbef Update nixpkgs 2025-09-19-01-03 2025-09-19 03:04:11 +02:00
Flake Update Bot
b9186fd631 Update from updated-inputs-2025-09-14-01-03 2025-09-14 03:04:53 +02:00
Flake Update Bot
987200902c Update nixpkgs 2025-09-14-01-03 2025-09-14 03:04:51 +02:00
Flake Update Bot
6f7c3dbe0d Update from updated-inputs-2025-09-12-01-03 2025-09-12 03:04:20 +02:00
Flake Update Bot
3edafb0950 Update nixpkgs 2025-09-12-01-03 2025-09-12 03:04:17 +02:00
539502cea0 flake.lock: Update mu5001tool 2025-09-12 00:10:03 +02:00
00a7eee2af hosts/astatine: Update mu5001tool and restart on failure 2025-09-11 12:39:04 +02:00
Flake Update Bot
c60e454a74 Update from updated-inputs-2025-09-10-01-03 2025-09-10 03:04:03 +02:00
Flake Update Bot
b4751311a9 Update nixpkgs 2025-09-10-01-03 2025-09-10 03:04:00 +02:00
Flake Update Bot
13ea199945 Update from updated-inputs-2025-09-09-01-03 2025-09-09 03:03:20 +02:00
Flake Update Bot
27c6d13fb8 Update nixpkgs 2025-09-09-01-03 2025-09-09 03:03:18 +02:00
e82132b86e hosts/astatine: Add stack to monitor zte hypermobile 5g 2025-09-08 23:32:57 +02:00
Flake Update Bot
53e12c43ae Update from updated-inputs-2025-09-08-01-03 2025-09-08 03:04:06 +02:00
Flake Update Bot
e918551325 Update nixpkgs 2025-09-08-01-03 2025-09-08 03:04:03 +02:00
Flake Update Bot
d629e7b4b1 Update from updated-inputs-2025-09-04-01-03 2025-09-04 03:04:16 +02:00
Flake Update Bot
b4345403b7 Update nixpkgs 2025-09-04-01-03 2025-09-04 03:04:14 +02:00
503dca182e pkgs/curl-timings: Add curl shortcut to show connection timings 2025-09-03 13:05:55 +02:00
Flake Update Bot
8d9f71622f Update from updated-inputs-2025-08-31-01-03 2025-08-31 03:04:15 +02:00
Flake Update Bot
f502b13e58 Update nixpkgs 2025-08-31-01-03 2025-08-31 03:04:12 +02:00
82f8064956 pkgs/grow-last-partition-and-filesystem: Add command to easily grow a filesystem on a disk resized by Proxmox 2025-08-30 11:11:57 +02:00
342d50d936 pkgs/bijwerken-system-upgrade: Copy system store path from any configured nix cache 2025-08-30 09:52:25 +02:00
Flake Update Bot
22485dd605 Update from updated-inputs-2025-08-30-01-03 2025-08-30 03:04:06 +02:00
Flake Update Bot
e9dfde7106 Update nixpkgs 2025-08-30-01-03 2025-08-30 03:04:04 +02:00
Flake Update Bot
77dbef155c Update from updated-inputs-2025-08-28-01-03 2025-08-28 03:04:08 +02:00
Flake Update Bot
d2d991b370 Update nixpkgs 2025-08-28-01-03 2025-08-28 03:04:05 +02:00
Flake Update Bot
fcc71b740d Update from updated-inputs-2025-08-27-01-03 2025-08-27 03:04:13 +02:00
Flake Update Bot
5fe51e24fb Update nixpkgs 2025-08-27-01-03 2025-08-27 03:04:06 +02:00
Flake Update Bot
bbcd7502da Update from updated-inputs-2025-08-21-01-03 2025-08-21 03:04:14 +02:00
Flake Update Bot
5a51ba653b Update nixpkgs 2025-08-21-01-03 2025-08-21 03:04:12 +02:00
Flake Update Bot
21b8712e9a Update from updated-inputs-2025-08-18-01-03 2025-08-18 03:04:34 +02:00
Flake Update Bot
168a349eed Update nixpkgs 2025-08-18-01-03 2025-08-18 03:04:29 +02:00
dd76691f7d pkgs/bijwerken-*,modules/bijwerken: Consolidate system update management and refactor under the same name 2025-08-17 21:49:24 +02:00
72cdef91d9 profiles/common-nix: Remove guests group from trusted nix users 2025-08-17 20:02:34 +02:00
22c7cb451b pkgs/nixfiles: Add helper script to trigger system upgrades 2025-08-17 19:05:22 +02:00
9357981ff3 hosts/monitoring-3: Alert on fem.social unavailable 2025-08-17 10:39:01 +02:00
eddb365ae5 hosts/monitoring-3: Alert nadja.top down after 15min only 2025-08-17 10:17:43 +02:00
Flake Update Bot
7ff50774fb Update from updated-inputs-2025-08-17-01-03 2025-08-17 03:03:22 +02:00
Flake Update Bot
2d78fa9140 Update nixpkgs 2025-08-17-01-03 2025-08-17 03:03:19 +02:00
d01de7fc4a hosts/monitoring-3: Add dashboards to deployment 2025-08-16 22:01:06 +02:00
Flake Update Bot
6d565ebab7 Update from updated-inputs-2025-08-16-01-03 2025-08-16 03:04:24 +02:00
Flake Update Bot
8f2f39f72e Update nixpkgs 2025-08-16-01-03 2025-08-16 03:04:21 +02:00
a1ca9313b9 hosts/monitoring-3: Add Nginx Grafana dashboard 2025-08-15 20:50:24 +02:00
217ede0307 modules/monitoring: Extract metrics from nginx logs 2025-08-15 18:14:41 +02:00
Flake Update Bot
e8d47ed733 Update from updated-inputs-2025-08-15-01-03 2025-08-15 03:03:21 +02:00
Flake Update Bot
397ec22243 Update nixpkgs 2025-08-15-01-03 2025-08-15 03:03:18 +02:00
643478b724 pkgs/generate-blocked-prefixes: Deduplicate prefixes before generating firewall rules 2025-08-14 20:20:33 +02:00
Flake Update Bot
fe16672c54 Update from updated-inputs-2025-08-14-01-03 2025-08-14 03:04:08 +02:00
Flake Update Bot
da8dbf71b7 Update nixpkgs 2025-08-14-01-03 2025-08-14 03:04:05 +02:00
Flake Update Bot
3b032019d6 Update from updated-inputs-2025-08-11-01-03 2025-08-11 03:04:15 +02:00
Flake Update Bot
cb446d8aad Update nixpkgs 2025-08-11-01-03 2025-08-11 03:04:13 +02:00
Flake Update Bot
1b448d351b Update from updated-inputs-2025-08-10-01-03 2025-08-10 03:03:10 +02:00
Flake Update Bot
6e814d97cb Update nixpkgs 2025-08-10-01-03 2025-08-10 03:03:08 +02:00
13b8ccd087 hosts/krypton: don't use onlyoffice anymore 2025-08-09 14:59:03 +02:00
7c3a97a90a hosts/web-2: Update legal.clerie.de 2025-08-09 11:42:04 +02:00
40338d9b85 hosts/monitoring-3: Monitor alertmanager 2025-08-09 11:41:34 +02:00
Flake Update Bot
8c4ea538ab Update from updated-inputs-2025-08-08-01-03 2025-08-08 03:04:07 +02:00
Flake Update Bot
50f5174c9e Update nixpkgs 2025-08-08-01-03 2025-08-08 03:04:04 +02:00
Flake Update Bot
ed94475d72 Update from updated-inputs-2025-08-05-01-03 2025-08-05 03:04:06 +02:00
Flake Update Bot
978bece407 Update nixpkgs 2025-08-05-01-03 2025-08-05 03:04:03 +02:00
Flake Update Bot
917aa88972 Update from updated-inputs-2025-08-02-01-03 2025-08-02 03:04:14 +02:00
Flake Update Bot
6e95a723e9 Update nixpkgs 2025-08-02-01-03 2025-08-02 03:04:11 +02:00
Flake Update Bot
a5c94d1dc3 Update from updated-inputs-2025-07-30-01-03 2025-07-30 03:04:16 +02:00
Flake Update Bot
576388333f Update nixpkgs 2025-07-30-01-03 2025-07-30 03:04:13 +02:00
7f6f6281cc profiles/desktop: Migrate from configuration 2025-07-29 23:03:58 +02:00
2d4acb5a49 flake.lock: Update lix 2025-07-29 18:04:22 +02:00
Flake Update Bot
d28dbba19f Update from updated-inputs-2025-07-29-01-03 2025-07-29 03:04:14 +02:00
Flake Update Bot
905682cf17 Update nixpkgs 2025-07-29-01-03 2025-07-29 03:04:11 +02:00
f5ec777e9b flake/hydraJobs.nix: Track additional packages in hydra 2025-07-28 22:48:59 +02:00
944bced757 pkgs/pipewire-all-bluetooth: A pipewire audio sink that distributes to all Bluetooth speakers 2025-07-28 22:36:49 +02:00
Flake Update Bot
cf8a3de1c5 Update from updated-inputs-2025-07-27-01-03 2025-07-27 03:04:08 +02:00
Flake Update Bot
802246dbc7 Update nixpkgs 2025-07-27-01-03 2025-07-27 03:04:05 +02:00
Flake Update Bot
c54e4bb73e Update from updated-inputs-2025-07-25-01-03 2025-07-25 03:04:07 +02:00
Flake Update Bot
90145577a1 Update nixpkgs 2025-07-25-01-03 2025-07-25 03:04:05 +02:00
Flake Update Bot
86d5a18d5f Update from updated-inputs-2025-07-21-01-03 2025-07-21 03:04:01 +02:00
Flake Update Bot
f9837a7270 Update nixpkgs 2025-07-21-01-03 2025-07-21 03:03:59 +02:00
Flake Update Bot
32f0f41a41 Update from updated-inputs-2025-07-19-01-03 2025-07-19 03:04:12 +02:00
Flake Update Bot
862f244c53 Update nixpkgs 2025-07-19-01-03 2025-07-19 03:04:09 +02:00
5bd15927d5 hosts/web-2: Block Alibaba Cloud because of scraper bots 2025-07-18 23:55:33 +02:00
Flake Update Bot
f8e00d0ae8 Update from updated-inputs-2025-07-16-01-03 2025-07-16 03:03:08 +02:00
Flake Update Bot
541a9ea00b Update nixpkgs 2025-07-16-01-03 2025-07-16 03:03:06 +02:00
9b05a008bb configuration/desktop: Add helvum audio routing gui 2025-07-15 19:39:46 +02:00
Flake Update Bot
2d0c6904d2 Update from updated-inputs-2025-07-15-17-28 2025-07-15 19:29:21 +02:00
Flake Update Bot
a0a381fa62 Update nixpkgs 2025-07-15-17-28 2025-07-15 19:29:19 +02:00
871ba5ea43 pkgs/uptimestatus: Explicitly specify build system 2025-07-15 19:26:50 +02:00
Flake Update Bot
be27bcc4b2 Update from updated-inputs-2025-07-13-01-03 2025-07-13 03:03:08 +02:00
Flake Update Bot
184b6bf635 Update nixpkgs 2025-07-13-01-03 2025-07-13 03:03:06 +02:00
560e53f77b hosts/krypton: Add drune3d program 2025-07-12 13:21:30 +02:00
Flake Update Bot
131629cb30 Update from updated-inputs-2025-07-10-01-03 2025-07-10 03:04:05 +02:00
Flake Update Bot
99b8e1d9a3 Update nixpkgs 2025-07-10-01-03 2025-07-10 03:04:03 +02:00
Flake Update Bot
39c6605e97 Update from updated-inputs-2025-07-08-01-03 2025-07-08 03:04:11 +02:00
Flake Update Bot
629bdcbee6 Update nixpkgs 2025-07-08-01-03 2025-07-08 03:04:08 +02:00
Flake Update Bot
4073d5deb0 Update from updated-inputs-2025-07-07-01-03 2025-07-07 03:04:07 +02:00
Flake Update Bot
d374139a8c Update nixpkgs 2025-07-07-01-03 2025-07-07 03:04:05 +02:00
03aa425038 hosts/web-2: Add traveldrafter.clerie.de 2025-07-06 18:17:31 +02:00
Flake Update Bot
1a989d5e35 Update from updated-inputs-2025-07-06-01-03 2025-07-06 03:04:11 +02:00
Flake Update Bot
28bb50319c Update nixpkgs 2025-07-06-01-03 2025-07-06 03:04:08 +02:00
751efd02bb hosts/porter: Enable system auto upgrade 2025-07-05 20:16:01 +02:00
Flake Update Bot
1092b0653c Update from updated-inputs-2025-07-02-01-03 2025-07-02 03:04:06 +02:00
Flake Update Bot
c23e7c5616 Update nixpkgs 2025-07-02-01-03 2025-07-02 03:04:03 +02:00
Flake Update Bot
4473180060 Update from updated-inputs-2025-07-01-01-03 2025-07-01 03:03:08 +02:00
Flake Update Bot
d9a76702aa Update nixpkgs 2025-07-01-01-03 2025-07-01 03:03:06 +02:00
43d1133772 modules/clerie-system-upgrade: Always reboot after an update 2025-06-30 18:35:57 +02:00
Flake Update Bot
508d65a4d7 Update from updated-inputs-2025-06-30-01-03 2025-06-30 03:04:01 +02:00
Flake Update Bot
815c65ea62 Update nixpkgs 2025-06-30-01-03 2025-06-30 03:03:59 +02:00
4245ae84ed hosts/carbon: Don't make kea depend on non existend network-setup.service anymore 2025-06-29 22:25:19 +02:00
b9f47fc30c flake.nix: Use patched nixpkgs for carbon 2025-06-29 17:29:01 +02:00
ce54f06fd0 flake/nixosConfigurations.nix: Handle host specific nixpkgs input again 2025-06-29 17:28:38 +02:00
457fa2ca6f lib/mkNixpkgs.nix: Add function to import nixpkgs with overlays 2025-06-29 16:56:41 +02:00
60e80ab2e9 profiles/gpg-ssh: Move gpg-ssh to profiles 2025-06-29 11:51:27 +02:00
4bf030c006 profiles/common-nix: Migrate nix common config zu profile 2025-06-29 11:34:11 +02:00
Flake Update Bot
e03f4f80eb Update from updated-inputs-2025-06-29-01-03 2025-06-29 03:04:08 +02:00
Flake Update Bot
cd3d0bd039 Update nixpkgs 2025-06-29-01-03 2025-06-29 03:04:05 +02:00
0204773d27 lib/nixosSystem.nix: Wrap nixpkgs.lib.nixosSystem and include nixfiles modules and overlays by default 2025-06-28 16:43:03 +02:00
a66da6cac9 lib/link-local-wireguard.nix: Remove obsolete functions 2025-06-28 16:27:06 +02:00
691d671420 pkgs/clerie-ssh-known-hosts: Expose function as package 2025-06-28 16:25:38 +02:00
fef845117e flake/nixosConfigurations.nix: Pull localNixpkgs directly instead of creating nixpkgs with local overlays again 2025-06-28 16:10:46 +02:00
11970e287c pkgs/build-support: Move clerie-build-support attribute name to overlay 2025-06-28 15:32:58 +02:00
cdc1a1e6de flake.nix: Add unused helper variable 2025-06-28 15:31:38 +02:00
e9b5dce77f flake.nix: Common naming scheme for overlays and no default overlays anymore 2025-06-28 15:22:16 +02:00
23190f0777 pkgs/overlay.nix: Get rid of pkgs/pkgs.nix and move overrides to separate overlay 2025-06-28 15:14:36 +02:00
1d927638c5 flake.nix: Exclude build support from flake exported packages and make pkgs/pkgs.nix obsolete again 2025-06-28 15:03:46 +02:00
a754af1ee9 configuration/desktop: Update renamed option name 2025-06-28 14:14:11 +02:00
617a27d4fe flake.lock: Update lix 2025-06-28 14:05:39 +02:00
eace2fabb2 pkgs/build-support: Add writePytonScript helper function 2025-06-28 14:03:57 +02:00
Flake Update Bot
e41dd5d155 Update from updated-inputs-2025-06-27-01-03 2025-06-27 03:04:12 +02:00
Flake Update Bot
721f6681e1 Update nixpkgs 2025-06-27-01-03 2025-06-27 03:04:09 +02:00
Flake Update Bot
6ea00acf99 Update from updated-inputs-2025-06-26-01-03 2025-06-26 03:04:12 +02:00
Flake Update Bot
30a7b4a99c Update nixpkgs 2025-06-26-01-03 2025-06-26 03:04:10 +02:00
Flake Update Bot
49dac5d8be Update from updated-inputs-2025-06-25-01-03 2025-06-25 03:03:08 +02:00
Flake Update Bot
a3a4d7303f Update nixpkgs 2025-06-25-01-03 2025-06-25 03:03:06 +02:00
86bfe85982 hosts/porter: Resolve nginx proxy upstreams via unbound 2025-06-24 16:42:03 +02:00
Flake Update Bot
4a176482b4 Update from updated-inputs-2025-06-23-01-03 2025-06-23 03:04:02 +02:00
Flake Update Bot
f6b34b5167 Update nixpkgs 2025-06-23-01-03 2025-06-23 03:03:59 +02:00
Flake Update Bot
0e4cb0ba61 Update from updated-inputs-2025-06-21-01-03 2025-06-21 03:04:14 +02:00
Flake Update Bot
badf143817 Update nixpkgs 2025-06-21-01-03 2025-06-21 03:04:12 +02:00
Flake Update Bot
8d9f34cfff Update from updated-inputs-2025-06-18-01-03 2025-06-18 03:04:05 +02:00
Flake Update Bot
7235e2c6e4 Update nixpkgs 2025-06-18-01-03 2025-06-18 03:04:03 +02:00
Flake Update Bot
c62e684eff Update from updated-inputs-2025-06-15-01-03 2025-06-15 03:04:10 +02:00
Flake Update Bot
5d49ae3198 Update nixpkgs 2025-06-15-01-03 2025-06-15 03:04:08 +02:00
Flake Update Bot
3b21620611 Update from updated-inputs-2025-06-12-01-03 2025-06-12 03:03:08 +02:00
Flake Update Bot
bd2dd28541 Update nixpkgs 2025-06-12-01-03 2025-06-12 03:03:06 +02:00
e24190ae08 hosts/dn42-il-gw1: Open firewall for wireguard tunnel ports 2025-06-11 08:07:13 +02:00
9755550435 hosts/dn42-il-gw1: AS4242421718 fix link local peer address 2025-06-11 08:06:42 +02:00
Flake Update Bot
4ce0696278 Update from updated-inputs-2025-06-11-01-03 2025-06-11 03:03:08 +02:00
Flake Update Bot
75c97843ef Update nixpkgs 2025-06-11-01-03 2025-06-11 03:03:06 +02:00
0dfc013122 hosts/dn42-il-gw1: Add peer AS4242421718 2025-06-10 23:08:38 +02:00
Flake Update Bot
fcf6cbf72b Update from updated-inputs-2025-06-09-01-03 2025-06-09 03:04:04 +02:00
Flake Update Bot
18ad63254c Update nixpkgs 2025-06-09-01-03 2025-06-09 03:04:02 +02:00
Flake Update Bot
509cd2f117 Update from updated-inputs-2025-06-07-01-03 2025-06-07 03:04:09 +02:00
Flake Update Bot
51ef710df6 Update nixpkgs 2025-06-07-01-03 2025-06-07 03:04:07 +02:00
Flake Update Bot
c51a42ae35 Update from updated-inputs-2025-06-05-01-03 2025-06-05 03:04:05 +02:00
Flake Update Bot
b7648df8b1 Update nixpkgs 2025-06-05-01-03 2025-06-05 03:04:02 +02:00
Flake Update Bot
edd5765535 Update from updated-inputs-2025-06-04-01-03 2025-06-04 03:03:08 +02:00
Flake Update Bot
0fa672ab51 Update nixpkgs 2025-06-04-01-03 2025-06-04 03:03:06 +02:00
3c85462f46 monitoring/targets.json: Check fem.social http 2025-06-03 15:43:05 +02:00
cc1790bf30 modules/nginx-port-forward: Proxy upstream DNS is only reresolved when referenced as a variable 2025-06-03 15:41:56 +02:00
Flake Update Bot
6feecd2966 Update from updated-inputs-2025-06-03-01-03 2025-06-03 03:03:06 +02:00
Flake Update Bot
beb5c981eb Update nixpkgs 2025-06-03-01-03 2025-06-03 03:03:04 +02:00
c97799b97c hosts/monitoring-3: Alert on broken IPv4 to IPv6 proxy 2025-06-02 18:46:43 +02:00
3b0986cc57 modules/nginx-port-forward: Hardcode dns response caching time to 30s 2025-06-02 18:30:35 +02:00
89a96632a2 pkgs/overrides: Disable openpgp support in dino 2025-06-02 18:16:33 +02:00
a7950d2466 pkgs/overrides: Deactivate notification sounds in dino 2025-06-02 18:04:25 +02:00
Flake Update Bot
30cdeb8d8a Update from updated-inputs-2025-06-02-01-03 2025-06-02 03:04:03 +02:00
Flake Update Bot
522bdf954d Update nixpkgs 2025-06-02-01-03 2025-06-02 03:04:01 +02:00
c31b68d96a flake.lock: Update bij 2025-06-01 22:20:33 +02:00
c49e26d828 modules/nginx-port-forward: Resolve upstream hostnames as IPv6 only 2025-06-01 20:32:50 +02:00
5add1baa8d flake.nix: Update lix 2025-06-01 14:50:29 +02:00
ff4b3579b3 monitoring/targets.json: Monitor some more websites 2025-06-01 14:25:38 +02:00
16f709b7aa monitoring/targets.json: Don't ping matrix hosts 2025-06-01 14:19:22 +02:00
096fe1dc03 profiles/monitoring-server: Monitor http 2025-06-01 14:08:57 +02:00
e475e46e3c profiles/monitoring-server: Fetch monitoring targets from json file 2025-06-01 13:31:43 +02:00
Flake Update Bot
83a6f253d4 Update from updated-inputs-2025-06-01-01-03 2025-06-01 03:03:08 +02:00
Flake Update Bot
82deb5e772 Update nixpkgs 2025-06-01-01-03 2025-06-01 03:03:06 +02:00
92f8495111 modules/nginx-port-forward: Automatically reresolve hostnames 2025-05-31 13:03:00 +02:00
50ca6f03ee hosts/porter: Proxy port 80 and 443 to baikonur 2025-05-31 13:02:18 +02:00
1a9475ad7f profiles/common-webserver: Migrate webserver config to profile 2025-05-31 13:00:43 +02:00
Flake Update Bot
b320181989 Update from updated-inputs-2025-05-31-01-03 2025-05-31 03:04:04 +02:00
Flake Update Bot
1fe735abf1 Update nixpkgs 2025-05-31-01-03 2025-05-31 03:04:01 +02:00
Flake Update Bot
9d025205a0 Update from updated-inputs-2025-05-30-01-03 2025-05-30 03:03:08 +02:00
Flake Update Bot
05418433ab Update nixpkgs 2025-05-30-01-03 2025-05-30 03:03:06 +02:00
fae30a0fc5 hosts/monitoring-3: Don't alert for /nix/store disk full 2025-05-29 12:16:26 +02:00
Flake Update Bot
ba00339952 Update from updated-inputs-2025-05-29-01-03 2025-05-29 03:04:04 +02:00
Flake Update Bot
0af9acf7e8 Update nixpkgs 2025-05-29-01-03 2025-05-29 03:04:01 +02:00
Flake Update Bot
e6a86358f7 Update from updated-inputs-2025-05-28-01-03 2025-05-28 03:03:07 +02:00
f70421d8f9 Revert "pkgs/overrides: Dino uses OMEMO by default for new conversations"
Fixed upstream

This reverts commit 1c087b0c9f.
2025-05-27 16:35:34 +02:00
Flake Update Bot
7ea27d0db1 Update from updated-inputs-2025-05-27-01-03 2025-05-27 03:04:05 +02:00
Flake Update Bot
3f2c0fc244 Update nixpkgs 2025-05-27-01-03 2025-05-27 03:04:02 +02:00
Flake Update Bot
7dbe07d361 Update from updated-inputs-2025-05-26-01-03 2025-05-26 03:04:06 +02:00
Flake Update Bot
5ea30c7fd4 Update nixpkgs 2025-05-26-01-03 2025-05-26 03:04:04 +02:00
cddd9b1a1e pkgs/git-show-link: Improve linking to directory 2025-05-25 20:48:07 +02:00
efad5a6cbb pkgs/git-show-link: Normalize paths 2025-05-25 20:21:51 +02:00
d334a1a73c pkgs/git-show-link: Link to files directly 2025-05-25 19:59:59 +02:00
4fa4c8d669 configuration/common: Don't force requests ca bundle environment var 2025-05-25 14:15:54 +02:00
Flake Update Bot
a57993a082 Update from updated-inputs-2025-05-25-01-03 2025-05-25 03:04:06 +02:00
Flake Update Bot
b4158bfc6e Update nixpkgs 2025-05-25-01-03 2025-05-25 03:04:03 +02:00
Flake Update Bot
fa6c8eb3fd Update from updated-inputs-2025-05-24-01-03 2025-05-24 03:03:08 +02:00
Flake Update Bot
4e2e1e9cc9 Update nixpkgs 2025-05-24-01-03 2025-05-24 03:03:06 +02:00
46d23fb98a pkgs/git-show-link: Specify URL format using --remote-type 2025-05-23 14:51:20 +02:00
4e56adef58 pkgs/git-show-link: Display error message when not executed in a git repo 2025-05-23 14:28:03 +02:00
Flake Update Bot
d13e56c1e0 Update from updated-inputs-2025-05-22-01-03 2025-05-22 03:04:06 +02:00
Flake Update Bot
0030949252 Update nixpkgs 2025-05-22-01-03 2025-05-22 03:04:04 +02:00
Flake Update Bot
0645c2f371 Update from updated-inputs-2025-05-20-01-03 2025-05-20 03:03:08 +02:00
Flake Update Bot
40a11a09d9 Update nixpkgs 2025-05-20-01-03 2025-05-20 03:03:06 +02:00
b93dc9f16b configuration/common: Make Python requests always use system CA 2025-05-19 18:43:38 +02:00
44d1a444ba pkgs/git-show-link: Handle branch names with slashes properly 2025-05-19 10:49:32 +02:00
Flake Update Bot
6e788b4e31 Update from updated-inputs-2025-05-19-01-03 2025-05-19 03:04:03 +02:00
Flake Update Bot
20f2e82e06 Update nixpkgs 2025-05-19-01-03 2025-05-19 03:04:00 +02:00
Flake Update Bot
8331d2d20f Update from updated-inputs-2025-05-18-01-03 2025-05-18 03:04:08 +02:00
Flake Update Bot
510cf63b2a Update nixpkgs 2025-05-18-01-03 2025-05-18 03:04:05 +02:00
Flake Update Bot
d92d54521e Update from updated-inputs-2025-05-16-01-03 2025-05-16 03:04:09 +02:00
Flake Update Bot
d7746c22c1 Update nixpkgs 2025-05-16-01-03 2025-05-16 03:04:06 +02:00
Flake Update Bot
9fd01dac79 Update from updated-inputs-2025-05-12-01-03 2025-05-12 03:04:01 +02:00
Flake Update Bot
92f337d886 Update nixpkgs 2025-05-12-01-03 2025-05-12 03:03:59 +02:00
125 changed files with 3572 additions and 877 deletions

View File

@@ -0,0 +1,11 @@
{ config, lib, ... }:
with lib;
{
environment.sessionVariables = {
REQUESTS_CA_BUNDLE = mkDefault config.security.pki.caBundle;
};
}

View File

@@ -3,15 +3,14 @@
{ {
imports = [ imports = [
./backup.nix ./backup.nix
./certificates.nix
./initrd.nix ./initrd.nix
./locale.nix ./locale.nix
./networking.nix ./networking.nix
./nix.nix
./programs.nix ./programs.nix
./ssh.nix ./ssh.nix
./systemd.nix ./systemd.nix
./user.nix ./user.nix
./web.nix
]; ];
services.fstrim.enable = true; services.fstrim.enable = true;

View File

@@ -1,70 +0,0 @@
{ lib, pkgs, ... }:
{
clerie.nixfiles.enable = true;
clerie.system-auto-upgrade.enable = true;
nix.settings = {
trusted-users = [ "@wheel" "@guests" ];
auto-optimise-store = true;
# Keep buildtime dependencies
keep-outputs = true;
# Build local, when caches are broken
fallback = true;
};
nix.gc = lib.mkDefault {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
nix.settings = {
experimental-features = [
"flakes"
"nix-command"
];
substituters = [
"https://nix-cache.clerie.de"
];
trusted-public-keys = [
"nix-cache.clerie.de:bAt1GJTS9BOTcXFWj3nURrSlcjqikCev9yDvqArMP5g="
];
};
# Pin current nixpkgs channel and flake registry to the nixpkgs version
# the host got build with
nix.nixPath = lib.mkForce [ "nixpkgs=${lib.cleanSource pkgs.path}" ];
nix.registry = {
"nixpkgs" = lib.mkForce {
from = {
type = "indirect";
id = "nixpkgs";
};
to = {
type = "path";
path = lib.cleanSource pkgs.path;
};
exact = true;
};
"templates" = {
from = {
type = "indirect";
id = "templates";
};
to = {
type = "git";
url = "https://git.clerie.de/clerie/flake-templates.git";
};
};
};
documentation.doc.enable = false;
environment.systemPackages = with pkgs; [
nix-remove-result-links
];
}

View File

@@ -6,6 +6,7 @@
# My system is fucked # My system is fucked
gptfdisk gptfdisk
parted parted
grow-last-partition-and-filesystem
# Normal usage # Normal usage
htop htop

View File

@@ -1,54 +0,0 @@
{ ... }:
{
services.nginx = {
enableReload = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
commonHttpConfig = ''
server_names_hash_bucket_size 64;
charset utf-8;
types {
text/plain nix;
}
map $remote_addr $remote_addr_anon {
~(?P<ip>\d+\.\d+\.\d+)\. $ip.0;
~(?P<ip>[^:]*:[^:]*(:[^:]*)?): $ip::;
default ::;
}
log_format combined_anon '$remote_addr_anon - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
log_format vcombined_anon '$host: $remote_addr_anon - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log vcombined_anon;
'';
virtualHosts = {
"default" = {
default = true;
rejectSSL = true;
locations."/" = {
return = ''200 "Some piece of infrastructure\n"'';
extraConfig = ''
types { } default_type "text/plain; charset=utf-8";
'';
};
};
};
};
services.logrotate.settings.nginx = {
frequency = "daily";
maxage = 14;
};
security.acme = {
defaults.email = "letsencrypt@clerie.de";
acceptTerms = true;
};
}

View File

@@ -1,19 +0,0 @@
{ ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse = {
enable = true;
};
};
}

View File

@@ -1,19 +0,0 @@
{ ... }:
{
imports = [
./audio.nix
./firmware.nix
./fonts.nix
./gnome.nix
./inputs.nix
./networking.nix
./polkit.nix
./power.nix
./printing.nix
./ssh.nix
./xserver.nix
];
security.sudo.wheelNeedsPassword = true;
}

View File

@@ -1,7 +0,0 @@
{ ... }:
{
services.fwupd.enable = true;
}

View File

@@ -1,13 +0,0 @@
{ pkgs, ... }:
{
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
roboto
roboto-mono
noto-fonts
noto-fonts-emoji
comfortaa
] ++ (if pkgs ? "noto-fonts-cjk-sans" then [ pkgs.noto-fonts-cjk-sans ] else [ pkgs.noto-fonts-cjk ]);
}

View File

@@ -1,61 +0,0 @@
{ pkgs, ... }:
{
services.gnome = {
localsearch.enable = false;
tinysparql.enable = false;
};
environment.gnome.excludePackages = with pkgs; [
baobab
epiphany
gnome-calendar
gnome-clocks
gnome-console
gnome-contacts
gnome-logs
gnome-maps
gnome-music
gnome-tour
gnome-photos
gnome-weather
gnome-connections
simple-scan
yelp
geary
];
environment.systemPackages = with pkgs; [
evolution
gnome-terminal
gnome-tweaks
];
services.gnome.evolution-data-server.enable = true;
programs.dconf.profiles = {
user.databases = [
{
settings = {
"org/gnome/desktop/calendar" = {
show-weekdate = true;
};
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
show-battery-percentage = true;
};
"org/gnome/desktop/notifications" = {
show-in-lock-screen = false;
};
"org/gnome/desktop/sound" = {
event-sounds = false;
};
"org/gnome/gnome-system-monitor" = {
network-in-bits = true;
network-total-in-bits = true;
};
};
}
];
};
}

View File

@@ -1,43 +0,0 @@
{ ... }:
{
programs.dconf.profiles = {
user.databases = [
{
settings = {
"org/gnome/desktop/peripherals/touchpad" = {
disable-while-typing = false;
edge-scrolling-enabled = false;
natural-scroll = true;
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
];
mic-mute = [ "<Control>Print" ];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = {
name = "Terminal";
binding = "<Primary><Alt>t";
command = "gnome-terminal";
};
};
}
];
gdm.databases = [
{
settings = {
"org/gnome/desktop/peripherals/touchpad" = {
disable-while-typing = false;
edge-scrolling-enabled = false;
natural-scroll = true;
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
};
}
];
};
}

View File

@@ -1,14 +0,0 @@
{ ... }:
{
networking.networkmanager.settings = {
connectivity = {
uri = "http://ping.clerie.de/nm-check.txt";
};
global-dns = {
searches = "net.clerie.de";
};
};
}

View File

@@ -1,7 +0,0 @@
{ ... }:
{
security.polkit.enable = true;
}

View File

@@ -1,42 +0,0 @@
{ lib, config, ... }:
{
boot.resumeDevice = lib.optionalString ((lib.length config.swapDevices) > 0) (lib.head config.swapDevices).device;
services.logind = {
lidSwitch = "suspend-then-hibernate";
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=30m
'';
services.upower = {
percentageLow = 20;
percentageCritical = 10;
percentageAction = 8;
};
programs.dconf.profiles = {
user.databases = [
{
settings = {
"org/gnome/settings-daemon/plugins/power" = {
power-button-action = "hibernate";
power-saver-profile-on-low-battery = false;
sleep-inactive-ac-type = "nothing";
};
};
}
];
gdm.databases = [
{
settings = {
"org/gnome/settings-daemon/plugins/power" = {
power-button-action = "hibernate";
power-saver-profile-on-low-battery = false;
sleep-inactive-ac-type = "nothing";
};
};
}
];
};
}

View File

@@ -1,7 +0,0 @@
{ ... }:
{
services.printing.enable = true;
services.avahi.enable = true;
services.avahi.nssmdns4 = true;
}

View File

@@ -1,34 +0,0 @@
{ pkgs, ... }:
{
imports = [
../../configuration/gpg-ssh
];
programs.gnupg.agent = {
pinentryPackage = pkgs.pinentry-gtk2;
};
# Do not disable ssh-agent of gnome-keyring, because
# gnupg ssh-agent can't handle normal SSH keys properly
/*
# Disable ssh-agent of gnome-keyring
nixpkgs.overlays = [
(final: prev: {
gnome = prev.gnome // {
gnome-keyring = prev.runCommand "gnome-keyring-ssh-disabled-autostart" {} ''
mkdir -p $out
# Symlink all gnome-keyring binaries
${final.xorg.lndir}/bin/lndir -silent ${prev.gnome.gnome-keyring} $out
# Disable autostart for ssh
rm $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
cat ${prev.gnome.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop > $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
echo "Hidden=true" >> $out/etc/xdg/autostart/gnome-keyring-ssh.desktop
'';
};
})
];
*/
}

View File

@@ -1,11 +0,0 @@
{ pkgs, ... }:
{
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.excludePackages = with pkgs; [
xterm
];
}

View File

@@ -1,51 +0,0 @@
{ pkgs, lib, ... }:
let
custom_gnupg = pkgs.gnupg.overrideAttrs (final: prev: {
configureFlags = prev.configureFlags ++ [
# Make sure scdaemon never ever again tries to use its own ccid driver
"--disable-ccid-driver"
];
});
in {
programs.gnupg.package = custom_gnupg;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = lib.mkDefault pkgs.pinentry-curses;
};
environment.systemPackages = with pkgs; [
custom_gnupg
yubikey-personalization
openpgp-card-tools
# Add wrapper around ssh that takes the gnupg ssh-agent
# instead of gnome-keyring
ssh-gpg
];
services.pcscd.enable = true;
# pcscd sometimes breaks and seem to need a manual restart
# so we allow users to restart that service themself
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
action.id == "org.freedesktop.systemd1.manage-units"
&& action.lookup("unit") == "pcscd.service"
&& action.lookup("verb") == "restart"
&& subject.isInGroup("users")
) {
return polkit.Result.YES;
}
});
'';
services.udev.packages = with pkgs; [
yubikey-personalization
];
}

380
flake.lock generated
View File

@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724513039, "lastModified": 1748808701,
"narHash": "sha256-YdBuRgXEU9CcxPd2EjuvDKcfgxL1kk9Gv8nFVVjIros=", "narHash": "sha256-IEer4ypv/tL2zzo7nkgyg7xdK6P+Mc/22oPctEgwhiw=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "202f4a1a5791c74a9b7d69a4e63e631bdbe36ba6", "rev": "5f3748df43e6b6e49cc0a23557a378ef37952483",
"revCount": 4, "revCount": 5,
"type": "git", "type": "git",
"url": "https://git.clerie.de/clerie/bij.git" "url": "https://git.clerie.de/clerie/bij.git"
}, },
@@ -116,6 +116,21 @@
} }
}, },
"flake-compat": { "flake-compat": {
"locked": {
"lastModified": 1746162366,
"narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@@ -153,28 +168,6 @@
} }
}, },
"flake-parts_2": { "flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"hydra",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"ssh-to-age", "ssh-to-age",
@@ -271,52 +264,55 @@
}, },
"hydra": { "hydra": {
"inputs": { "inputs": {
"lix": [ "flake-compat": "flake-compat",
"lix" "lix": "lix",
], "nixpkgs": "nixpkgs_3"
"nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1744102671, "lastModified": 1759516991,
"narHash": "sha256-/y92PMLAG1ueMInNKaar27H6voo5m1jDnJhxcIYOp5M=", "narHash": "sha256-esoe/uYPyy4a6hAwZq1QgkSe7dnZ5c0zHHXDq/JG9Yk=",
"ref": "lix-2.92", "ref": "lix-2.93",
"rev": "dd8114c53075524d06ba1de3346e39610923427b", "rev": "b1328322a49e8e153635ea8b3b602db363de727f",
"revCount": 4235, "revCount": 4284,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/hydra.git" "url": "https://git.lix.systems/lix-project/hydra.git"
}, },
"original": { "original": {
"ref": "lix-2.92", "ref": "lix-2.93",
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/hydra.git" "url": "https://git.lix.systems/lix-project/hydra.git"
} }
}, },
"lix": { "lix": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": [
"hydra",
"flake-compat"
],
"nix2container": "nix2container", "nix2container": "nix2container",
"nix_2_18": [
"hydra"
],
"nixpkgs": [ "nixpkgs": [
"hydra",
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-regression": "nixpkgs-regression", "nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1742250400, "lastModified": 1757791921,
"narHash": "sha256-be2mY7VFiWcPw7GcaJBbUvpnpoLd39wxqTXagBNTR5w=", "narHash": "sha256-83qbJckLOLrAsKO88UI9N4QRatNEc3gUFtLMiAPwK0g=",
"ref": "release-2.92", "ref": "release-2.93",
"rev": "d8db15010d2059a23a17f70ef542b4d1e7d2c640", "rev": "b7c2f17e9133e8b85d41c58b52f9d4e3254f41da",
"revCount": 16651, "revCount": 17892,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/lix.git" "url": "https://git.lix.systems/lix-project/lix"
}, },
"original": { "original": {
"ref": "release-2.92", "ref": "release-2.93",
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/lix.git" "url": "https://git.lix.systems/lix-project/lix"
} }
}, },
"lix-module": { "lix-module": {
@@ -331,20 +327,62 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742943028, "lastModified": 1756125859,
"narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", "narHash": "sha256-6a+PWILmqHCs9B5eIBLg6HSZ8jYweZpgOWO8FlyVwYI=",
"ref": "release-2.92", "ref": "release-2.93",
"rev": "3fae818597ca2f1474de62022f850c23be50528d", "rev": "d3292125035b04df00d01549a26e948631fabe1e",
"revCount": 134, "revCount": 156,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module.git" "url": "https://git.lix.systems/lix-project/nixos-module.git"
}, },
"original": { "original": {
"ref": "release-2.92", "ref": "release-2.93",
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module.git" "url": "https://git.lix.systems/lix-project/nixos-module.git"
} }
}, },
"lix_2": {
"inputs": {
"flake-compat": "flake-compat_2",
"nix2container": "nix2container_2",
"nix_2_18": "nix_2_18",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression_2",
"pre-commit-hooks": "pre-commit-hooks_2"
},
"locked": {
"lastModified": 1759940703,
"narHash": "sha256-/dXDCzYnQbkqCsvUDIxgIH4BS/fyxIu73m2v4ftJLXQ=",
"ref": "release-2.93",
"rev": "75c03142049242a5687309e59e4f356fbc92789a",
"revCount": 17894,
"type": "git",
"url": "https://git.lix.systems/lix-project/lix.git"
},
"original": {
"ref": "release-2.93",
"type": "git",
"url": "https://git.lix.systems/lix-project/lix.git"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"mitel-ommclient2": { "mitel-ommclient2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -366,55 +404,24 @@
"url": "https://git.clerie.de/clerie/mitel_ommclient2.git" "url": "https://git.clerie.de/clerie/mitel_ommclient2.git"
} }
}, },
"nix-eval-jobs": { "mu5001tool": {
"inputs": {
"flake-parts": "flake-parts_2",
"lix": [
"hydra",
"lix"
],
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"hydra",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1737237842,
"narHash": "sha256-tPr61X9v/OMVt7VXOs1RRStciwN8gDGxEKx+h0/Fg48=",
"ref": "release-2.92",
"rev": "fdaeb722d05a3ac58daaa24d4b5fa8db4457d82e",
"revCount": 621,
"type": "git",
"url": "https://git.lix.systems/lix-project/nix-eval-jobs"
},
"original": {
"ref": "release-2.92",
"type": "git",
"url": "https://git.lix.systems/lix-project/nix-eval-jobs"
}
},
"nix-github-actions": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"hydra",
"nix-eval-jobs",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1731952509, "lastModified": 1757627777,
"narHash": "sha256-p4gB3Rhw8R6Ak4eMl8pqjCPOLCZRqaehZxdZ/mbFClM=", "narHash": "sha256-NGUqHQ+/BaUhjgSYQauTihTtNyhhnQRMJ8t7ZSPNpmk=",
"owner": "nix-community", "ref": "refs/heads/main",
"repo": "nix-github-actions", "rev": "b7b0f0d5191433bca1377f7d818b800627a83fda",
"rev": "7b5f051df789b6b20d259924d349a9ba3319b226", "revCount": 9,
"type": "github" "type": "git",
"url": "https://git.clerie.de/clerie/mu5001tool.git"
}, },
"original": { "original": {
"owner": "nix-community", "type": "git",
"repo": "nix-github-actions", "url": "https://git.clerie.de/clerie/mu5001tool.git"
"type": "github"
} }
}, },
"nix2container": { "nix2container": {
@@ -433,6 +440,50 @@
"type": "github" "type": "github"
} }
}, },
"nix2container_2": {
"flake": false,
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nix_2_18": {
"inputs": {
"flake-compat": [
"lix",
"flake-compat"
],
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs_4",
"nixpkgs-regression": [
"lix",
"nixpkgs-regression"
]
},
"locked": {
"lastModified": 1730375271,
"narHash": "sha256-RrOFlDGmRXcVRV2p2HqHGqvzGNyWoD0Dado/BNlJ1SI=",
"owner": "NixOS",
"repo": "nix",
"rev": "0f665ff6779454f2117dcc32e44380cda7f45523",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "2.18.9",
"repo": "nix",
"type": "github"
}
},
"nixos-exporter": { "nixos-exporter": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -501,6 +552,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-carbon": {
"locked": {
"lastModified": 1751206202,
"narHash": "sha256-VjK8pEv4cfDpCTh4KW1go98kP25j7KdTNEce342Bh/Y=",
"owner": "clerie",
"repo": "nixpkgs",
"rev": "ac4ac98609c1b30c378458ab7207a9a5b5148457",
"type": "github"
},
"original": {
"owner": "clerie",
"ref": "clerie/always-setup-netdevs",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": { "nixpkgs-regression": {
"locked": { "locked": {
"lastModified": 1643052045, "lastModified": 1643052045,
@@ -517,6 +584,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-regression_2": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1713434076, "lastModified": 1713434076,
@@ -551,11 +634,43 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1746663147, "lastModified": 1759281824,
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=", "narHash": "sha256-FIBE1qXv9TKvSNwst6FumyHwCRH3BlWDpfsnqRDCll0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54", "rev": "5b5be50345d4113d04ba58c444348849f5585b4a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1705033721,
"narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1762977756,
"narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -601,6 +716,22 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks_2": {
"flake": false,
"locked": {
"lastModified": 1733318908,
"narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"rainbowrss": { "rainbowrss": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -630,18 +761,21 @@
"fieldpoc": "fieldpoc", "fieldpoc": "fieldpoc",
"harmonia": "harmonia", "harmonia": "harmonia",
"hydra": "hydra", "hydra": "hydra",
"lix": "lix", "lix": "lix_2",
"lix-module": "lix-module", "lix-module": "lix-module",
"mu5001tool": "mu5001tool",
"nixos-exporter": "nixos-exporter", "nixos-exporter": "nixos-exporter",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_5",
"nixpkgs-0dc1c7": "nixpkgs-0dc1c7", "nixpkgs-0dc1c7": "nixpkgs-0dc1c7",
"nixpkgs-carbon": "nixpkgs-carbon",
"nurausstieg": "nurausstieg", "nurausstieg": "nurausstieg",
"rainbowrss": "rainbowrss", "rainbowrss": "rainbowrss",
"scan-to-gpg": "scan-to-gpg", "scan-to-gpg": "scan-to-gpg",
"solid-xmpp-alarm": "solid-xmpp-alarm", "solid-xmpp-alarm": "solid-xmpp-alarm",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"ssh-to-age": "ssh-to-age" "ssh-to-age": "ssh-to-age",
"traveldrafter": "traveldrafter"
} }
}, },
"scan-to-gpg": { "scan-to-gpg": {
@@ -707,7 +841,7 @@
}, },
"ssh-to-age": { "ssh-to-age": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@@ -756,6 +890,26 @@
"type": "github" "type": "github"
} }
}, },
"traveldrafter": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1751817360,
"narHash": "sha256-HzOhsPvzCaFeiz8nPq5MkYnYHpUzVaU/P5sxG+Njt+8=",
"ref": "refs/heads/main",
"rev": "b6610d70f363ecf9704352b1ef39244a816bd34f",
"revCount": 22,
"type": "git",
"url": "https://git.clerie.de/clerie/traveldrafter.git"
},
"original": {
"type": "git",
"url": "https://git.clerie.de/clerie/traveldrafter.git"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -776,28 +930,6 @@
"repo": "treefmt-nix", "repo": "treefmt-nix",
"type": "github" "type": "github"
} }
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"hydra",
"nix-eval-jobs",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732292307,
"narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "705df92694af7093dfbb27109ce16d828a79155f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -1,6 +1,7 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-carbon.url = "github:clerie/nixpkgs/clerie/always-setup-netdevs";
# for etesync-dav # for etesync-dav
nixpkgs-0dc1c7.url = "github:NixOS/nixpkgs/0dc1c7294c13f5d1dd6eccab4f75d268d7296efe"; nixpkgs-0dc1c7.url = "github:NixOS/nixpkgs/0dc1c7294c13f5d1dd6eccab4f75d268d7296efe";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
@@ -25,20 +26,24 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hydra = { hydra = {
url = "git+https://git.lix.systems/lix-project/hydra.git?ref=lix-2.92"; url = "git+https://git.lix.systems/lix-project/hydra.git?ref=lix-2.93";
inputs.lix.follows = "lix"; #inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs"; #inputs.nixpkgs.follows = "nixpkgs";
}; };
lix = { lix = {
url = "git+https://git.lix.systems/lix-project/lix.git?ref=release-2.92"; url = "git+https://git.lix.systems/lix-project/lix.git?ref=release-2.93";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
lix-module = { lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module.git?ref=release-2.92"; url = "git+https://git.lix.systems/lix-project/nixos-module.git?ref=release-2.93";
inputs.lix.follows = "lix"; inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
fieldpoc.url = "git+https://git.clerie.de/clerie/fieldpoc.git"; fieldpoc.url = "git+https://git.clerie.de/clerie/fieldpoc.git";
mu5001tool = {
url = "git+https://git.clerie.de/clerie/mu5001tool.git";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-exporter = { nixos-exporter = {
url = "git+https://git.clerie.de/clerie/nixos-exporter.git"; url = "git+https://git.clerie.de/clerie/nixos-exporter.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -67,11 +72,13 @@
url = "github:Mic92/ssh-to-age"; url = "github:Mic92/ssh-to-age";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
traveldrafter = {
url = "git+https://git.clerie.de/clerie/traveldrafter.git";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, nixos-hardware, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ssh-to-age, ... }@inputs: let outputs = { self, nixpkgs, nixos-hardware, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ssh-to-age, ... }@inputs: let
lib = import ./lib inputs; lib = import ./lib inputs;
helper = lib.flake-helper;
localNixpkgs = import ./flake/nixpkgs.nix inputs;
in { in {
clerie.hosts = { clerie.hosts = {
aluminium = { aluminium = {
@@ -135,14 +142,24 @@
}; };
overlays = { overlays = {
nixfilesInputs = import ./flake/overlay.nix inputs; clerie-inputs = import ./flake/inputs-overlay.nix inputs;
clerie = import ./pkgs/overlay.nix; clerie-pkgs = import ./pkgs/overlay.nix;
default = self.overlays.clerie; clerie-build-support = import ./pkgs/build-support/overlay.nix;
clerie-overrides = import ./pkgs/overrides/overlay.nix;
}; };
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let nixpkgs = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system:
pkgs = localNixpkgs.${system}; lib.mkNixpkgs {
in builtins.mapAttrs (name: value: pkgs."${name}") (import ./pkgs/pkgs.nix)); inherit system;
}
);
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system:
nixpkgs.lib.genAttrs (
(builtins.attrNames (self.overlays.clerie-pkgs null null))
++ (builtins.attrNames (self.overlays.clerie-overrides null null))
) (name: self.nixpkgs."${system}"."${name}")
);
inherit lib self; inherit lib self;

View File

@@ -10,6 +10,12 @@ let
in { in {
inherit (self) inherit (self)
packages; packages;
extraTrackedPackages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system:
nixpkgs.lib.genAttrs [
"hydra"
"lix"
] (name: self.nixpkgs."${system}"."${name}")
);
nixosConfigurations = buildHosts self.nixosConfigurations; nixosConfigurations = buildHosts self.nixosConfigurations;
iso = self.nixosConfigurations._iso.config.system.build.isoImage; iso = self.nixosConfigurations._iso.config.system.build.isoImage;
} }

View File

@@ -5,10 +5,12 @@
, chaosevents , chaosevents
, harmonia , harmonia
, hydra , hydra
, mu5001tool
, nurausstieg , nurausstieg
, rainbowrss , rainbowrss
, scan-to-gpg , scan-to-gpg
, ssh-to-age , ssh-to-age
, traveldrafter
, ... , ...
}@inputs: }@inputs:
final: prev: { final: prev: {
@@ -24,6 +26,8 @@ final: prev: {
harmonia; harmonia;
inherit (hydra.packages.${final.system}) inherit (hydra.packages.${final.system})
hydra; hydra;
inherit (mu5001tool.packages.${final.system})
mu5001tool;
inherit (nurausstieg.packages.${final.system}) inherit (nurausstieg.packages.${final.system})
nurausstieg; nurausstieg;
inherit (rainbowrss.packages.${final.system}) inherit (rainbowrss.packages.${final.system})
@@ -32,4 +36,6 @@ final: prev: {
scan-to-gpg; scan-to-gpg;
inherit (ssh-to-age.packages.${final.system}) inherit (ssh-to-age.packages.${final.system})
ssh-to-age; ssh-to-age;
inherit (traveldrafter.packages.${final.system})
traveldrafter;
} }

View File

@@ -11,33 +11,14 @@ let
modules ? [], modules ? [],
}: let }: let
localNixpkgs = nixpkgs.lib.attrByPath [ "nixpkgs-${name}" ] nixpkgs inputs; localNixpkgs = nixpkgs.lib.attrByPath [ "nixpkgs-${name}" ] nixpkgs inputs;
in localNixpkgs.lib.nixosSystem { in self.lib.nixosSystem {
system = system; system = system;
nixpkgs = localNixpkgs;
modules = modules ++ [ modules = modules ++ [
self.nixosModules.nixfilesInputs
self.nixosModules.clerie
self.nixosModules.profiles
({ config, lib, ... }: { ({ config, lib, ... }: {
# Set hostname # Set hostname
networking.hostName = lib.mkDefault name; networking.hostName = lib.mkDefault name;
# Apply overlays
nixpkgs.overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie
];
/*
Make the contents of the flake availiable to modules.
Useful for having the monitoring server scraping the
target config from all other servers automatically.
*/
_module.args = {
inputs = inputs;
_nixfiles = self;
};
# Expose host group to monitoring # Expose host group to monitoring
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; }; clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };

View File

@@ -1,17 +0,0 @@
{ self
, nixpkgs
, ...
}@inputs:
let
mkNixpkgs = { system, ... }@args:
import nixpkgs {
inherit system;
overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie
];
};
in
nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: mkNixpkgs { inherit system; })

View File

@@ -3,9 +3,9 @@
{ {
imports = [ imports = [
(modulesPath + "/installer/cd-dvd/installation-cd-base.nix") (modulesPath + "/installer/cd-dvd/installation-cd-base.nix")
../../configuration/gpg-ssh
]; ];
profiles.clerie.gpg-ssh.enable = true;
profiles.clerie.network-fallback-dhcp.enable = true; profiles.clerie.network-fallback-dhcp.enable = true;
# systemd in initrd is broken with ISOs # systemd in initrd is broken with ISOs

View File

@@ -4,6 +4,10 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
./grafana.nix
./mu5001tool.nix
./prometheus.nix
]; ];
profiles.clerie.network-fallback-dhcp.enable = true; profiles.clerie.network-fallback-dhcp.enable = true;
@@ -18,6 +22,16 @@
terminal_output serial terminal_output serial
"; ";
sops.secrets.monitoring-htpasswd = {
owner = "nginx";
group = "nginx";
};
services.nginx = {
enable = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
profiles.clerie.wg-clerie = { profiles.clerie.wg-clerie = {
enable = true; enable = true;
ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ]; ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ];

View File

@@ -0,0 +1,45 @@
{ config, ... }:
{
services.grafana = {
enable = true;
settings = {
server = {
domain = "grafana.astatine.net.clerie.de";
root_url = "https://grafana.astatine.net.clerie.de";
http_port = 3001;
http_addr = "::1";
};
"auth.anonymous" = {
enabled = true;
};
};
provision = {
enable = true;
datasources.settings.datasources = [
{
type = "prometheus";
name = "Prometheus";
url = "http://[::1]:9090";
isDefault = true;
}
];
};
};
services.nginx = {
virtualHosts = {
"grafana.astatine.net.clerie.de" = {
enableACME = true;
forceSSL = true;
basicAuthFile = config.sops.secrets.monitoring-htpasswd.path;
locations."/".proxyPass = "http://[::1]:3001/";
locations."= /api/live/ws" = {
proxyPass = "http://[::1]:3001";
proxyWebsockets = true;
};
};
};
};
}

View File

@@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
{
systemd.services."mu5001tool" = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
LoadCredential = "zte-hypermobile-5g-password:${config.sops.secrets."zte-hypermobile-5g-password".path}";
Restart = "on-failure";
RestartSec = "15s";
};
script = ''
${lib.getExe pkgs.mu5001tool} --password-file ''${CREDENTIALS_DIRECTORY}/zte-hypermobile-5g-password prometheus-exporter --listen-port 9242
'';
};
}

View File

@@ -0,0 +1,46 @@
{ config, ... }:
{
services.prometheus = {
enable = true;
enableReload = true;
listenAddress = "[::1]";
scrapeConfigs = [
{
job_name = "prometheus";
scrape_interval = "20s";
scheme = "http";
static_configs = [
{
targets = [
"[::1]:9090"
];
}
];
}
{
job_name = "mu5001tool";
scrape_interval = "20s";
static_configs = [
{
targets = [
"[::1]:9242"
];
}
];
}
];
};
services.nginx = {
virtualHosts = {
"prometheus.astatine.net.clerie.de" = {
enableACME = true;
forceSSL = true;
basicAuthFile = config.sops.secrets.monitoring-htpasswd.path;
locations."/".proxyPass = "http://[::1]:9090/";
};
};
};
}

View File

@@ -1,19 +1,17 @@
{ {
"wg-clerie": "ENC[AES256_GCM,data:DbchcO6GTmSFyoHrRAkfu2flaKYrQHPk+rIerekYO4Cto9sqaWLgaSigpS8=,iv:no1xNRVqsKzAN6ssYA0Ir+utOM9tg8OBUT9PY2v0HPA=,tag:lZj1wEPFWHaf52N7YHEQKQ==,type:str]", "wg-clerie": "ENC[AES256_GCM,data:DbchcO6GTmSFyoHrRAkfu2flaKYrQHPk+rIerekYO4Cto9sqaWLgaSigpS8=,iv:no1xNRVqsKzAN6ssYA0Ir+utOM9tg8OBUT9PY2v0HPA=,tag:lZj1wEPFWHaf52N7YHEQKQ==,type:str]",
"wg-monitoring": "ENC[AES256_GCM,data:dTKKeieaGvECkHUpATLorhOgr9Re5CAH25y1WTcSqJZDsvnwD4CBbqMv2QQ=,iv:u1n1wyAW5aNcVYfGN8BmrEhIhtA3EfRDBNu65IdBZMI=,tag:RJYgOpel9uy6dC72MmqS5A==,type:str]", "wg-monitoring": "ENC[AES256_GCM,data:dTKKeieaGvECkHUpATLorhOgr9Re5CAH25y1WTcSqJZDsvnwD4CBbqMv2QQ=,iv:u1n1wyAW5aNcVYfGN8BmrEhIhtA3EfRDBNu65IdBZMI=,tag:RJYgOpel9uy6dC72MmqS5A==,type:str]",
"monitoring-htpasswd": "ENC[AES256_GCM,data:0uQ+Gwedi9kTaOzrwVzkNkS9qL0Dwmph1leK2sj/TndfSn3yaq7ur7ZHoPjWUl5Oy1poxU2rIUxWHajYC0n3yHv2AuGT,iv:FyH4MHcgW5iHkAsahNFtshnqqPOMlukg8aYfhcN9onw=,tag:q3BsnyKLrKYi/xDP6GmSkA==,type:str]",
"zte-hypermobile-5g-password": "ENC[AES256_GCM,data:lqxQICmWYwMejn8=,iv:TPYOs/cL/ETw7Ee0+YG/+Fhd7ASi0kr4rDLEiste+2Y=,tag:6O6AXIHkIjPm7hJVC4Y/1g==,type:str]",
"sops": { "sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [ "age": [
{ {
"recipient": "age1fffvnazdv3ys9ww8v4g832hv5nkvnk6d728syerzvpgskfmfkq8q00whpv", "recipient": "age1fffvnazdv3ys9ww8v4g832hv5nkvnk6d728syerzvpgskfmfkq8q00whpv",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMQUF5dkRwdXRmUkJ1SXN5\nLzdOVkhWYUJGdFd4Qklsa1BXeVZlTGx0eDE0ClZmYWNLMEVzaVVXWGkwQUt5ZHF5\nS1c5OU9PWjBTelM5R2phNFdVNncxUUkKLS0tIDlwSXFyZWNVT1dtdGU5dVFSRHNE\nUUpJZHJZRTd6TnBUU2dCWW90UTRVb0UKCWrHWmQTNhez16wgEKj4EQA4+UBRmGQn\n+NHSjBCMBmmTdHb05nENYVK515Z0T/60+9N3VlNyHWS9IgC3mZRUBg==\n-----END AGE ENCRYPTED FILE-----\n" "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBMQUF5dkRwdXRmUkJ1SXN5\nLzdOVkhWYUJGdFd4Qklsa1BXeVZlTGx0eDE0ClZmYWNLMEVzaVVXWGkwQUt5ZHF5\nS1c5OU9PWjBTelM5R2phNFdVNncxUUkKLS0tIDlwSXFyZWNVT1dtdGU5dVFSRHNE\nUUpJZHJZRTd6TnBUU2dCWW90UTRVb0UKCWrHWmQTNhez16wgEKj4EQA4+UBRmGQn\n+NHSjBCMBmmTdHb05nENYVK515Z0T/60+9N3VlNyHWS9IgC3mZRUBg==\n-----END AGE ENCRYPTED FILE-----\n"
} }
], ],
"lastmodified": "2024-04-21T16:03:13Z", "lastmodified": "2025-09-08T21:03:41Z",
"mac": "ENC[AES256_GCM,data:fA8fhOZbX30TYgwZXB7sQDNmck0JRDyAnEXf5nCYtli/Qvs78fTs4DdC08VOpOni8uAVARkFsGSo6Fjo/MpTSDVA8VNYZig/we/bWF+LQlEMCmiqwOI1R6eQ3GPxcRXltlO2aPPlT9BpLwIVZjGGjIsmjpVE8xjkCbLUUqj+UxY=,iv:fHLyw96QLVRrAQky2kR7TDDxf8CNXDV9lVQ5RETzJEI=,tag:y+cG9u3d6vCUmPyNMDRWpA==,type:str]", "mac": "ENC[AES256_GCM,data:ztS/Z6mn8hFAPsks2evJRJFocw/3oz22O2HeSEkY7Mu+bfNvClsJuvuTbnDadB0IwKiLDFWRMGs/UPFmNP6J/euro4cFHDWXopdXg7eDFGDoJDKIg4fBUtofdXIqWvDoQ9LeZNvc5Z4EEQYhs3LwFnAU0x15acwIIxr5TB9l8g8=,iv:WVjavmcrEs2CyYTfoTTP44c9TqFubUdE+PBN2jRPR+s=,tag:fBXzU69Q9MwD3o/Nyu5OZA==,type:str]",
"pgp": [ "pgp": [
{ {
"created_at": "2024-04-21T16:02:41Z", "created_at": "2024-04-21T16:02:41Z",
@@ -24,4 +22,4 @@
"unencrypted_suffix": "_unencrypted", "unencrypted_suffix": "_unencrypted",
"version": "3.8.1" "version": "3.8.1"
} }
} }

View File

@@ -6,6 +6,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
./dns.nix ./dns.nix
./ds-lite-ncfttb.nix
./mdns.nix ./mdns.nix
./net-dsl.nix ./net-dsl.nix
./net-gastnetz.nix ./net-gastnetz.nix
@@ -16,7 +17,7 @@
./net-printer.nix ./net-printer.nix
./net-voip.nix ./net-voip.nix
./ntp.nix ./ntp.nix
./ppp.nix ./ppp-ncfttb.nix
./scan-to-gpg.nix ./scan-to-gpg.nix
./wg-clerie.nix ./wg-clerie.nix
]; ];
@@ -39,7 +40,7 @@
networking.nat = { networking.nat = {
enableIPv6 = true; enableIPv6 = true;
enable = true; enable = true;
externalInterface = "ppp-dtagdsl"; externalInterface = "ppp-ncfttb";
internalIPv6s = [ "fd00:152:152::/48" "fd00:3214:9453:4920::/64"]; internalIPv6s = [ "fd00:152:152::/48" "fd00:3214:9453:4920::/64"];
internalIPs = [ "10.152.0.0/16" "192.168.32.0/24" ]; internalIPs = [ "10.152.0.0/16" "192.168.32.0/24" ];
}; };
@@ -63,10 +64,10 @@
systemd.services.kea-dhcp4-server = { systemd.services.kea-dhcp4-server = {
after = [ after = [
"network-setup.service" "network.target"
]; ];
requires = [ wants = [
"network-setup.service" "network.target"
]; ];
}; };

View File

@@ -0,0 +1,18 @@
{ ... }:
{
profiles.clerie.ds-lite = {
enable = true;
wanInterfaceName = "ppp-ncfttb";
tunnelInterfaceName = "ds-lite-ncfttb";
lanInterfaces = [
{
name = "net-heimnetz";
sla_id = 201;
prefix_len = 64;
}
];
};
}

View File

@@ -3,17 +3,17 @@
{ {
## DSL-Uplink ## DSL-Uplink
networking.vlans."enp1s0.7" = { networking.vlans."enp1s0.10" = {
id = 7; id = 10;
interface = "enp1s0"; interface = "enp1s0";
}; };
networking.vlans."enp3s0.7" = { networking.vlans."enp3s0.10" = {
id = 7; id = 10;
interface = "enp3s0"; interface = "enp3s0";
}; };
networking.bridges."net-dsl".interfaces = [ networking.bridges."net-dsl".interfaces = [
"enp1s0.7" "enp1s0.10"
"enp3s0.7" "enp3s0.10"
]; ];
} }

View File

@@ -61,7 +61,7 @@
# net-gastnetz can only access internet # net-gastnetz can only access internet
clerie.firewall.extraForwardFilterCommands = '' clerie.firewall.extraForwardFilterCommands = ''
ip46tables -A forward-filter -i net-gastnetz -o ppp-dtagdsl -j ACCEPT ip46tables -A forward-filter -i net-gastnetz -o ppp-ncfttb -j ACCEPT
ip46tables -A forward-filter -i net-gastnetz -j DROP ip46tables -A forward-filter -i net-gastnetz -j DROP
ip46tables -A forward-filter -o net-gastnetz -j DROP ip46tables -A forward-filter -o net-gastnetz -j DROP
''; '';

View File

@@ -4,11 +4,11 @@
services.pppd = { services.pppd = {
enable = true; enable = true;
peers.dtagdsl = { peers.ncfttb = {
config = '' config = ''
plugin pppoe.so net-dsl plugin pppoe.so net-dsl
user "''${PPPD_DTAGDSL_USERNAME}" user "''${PPPD_NETCOLOGNE_USERNAME}"
ifname ppp-dtagdsl ifname ppp-ncfttb
persist persist
maxfail 0 maxfail 0
holdoff 5 holdoff 5
@@ -24,9 +24,9 @@
}; };
}; };
environment.etc."ppp/peers/dtagdsl".enable = false; environment.etc."ppp/peers/ncfttb".enable = false;
systemd.services."pppd-dtagdsl".serviceConfig = let systemd.services."pppd-ncfttb".serviceConfig = let
preStart = '' preStart = ''
mkdir -p /etc/ppp/peers mkdir -p /etc/ppp/peers
@@ -34,22 +34,22 @@
umask u=rw,g=,o= umask u=rw,g=,o=
# Copy config and substitute username # Copy config and substitute username
rm -f /etc/ppp/peers/dtagdsl rm -f /etc/ppp/peers/ncfttb
${pkgs.envsubst}/bin/envsubst -i "${config.environment.etc."ppp/peers/dtagdsl".source}" > /etc/ppp/peers/dtagdsl ${pkgs.envsubst}/bin/envsubst -i "${config.environment.etc."ppp/peers/ncfttb".source}" > /etc/ppp/peers/ncfttb
# Copy login secrets # Copy login secrets
rm -f /etc/ppp/pap-secrets rm -f /etc/ppp/pap-secrets
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/pap-secrets cat ${config.sops.secrets.pppd-ncfttb-secrets.path} > /etc/ppp/pap-secrets
rm -f /etc/ppp/chap-secrets rm -f /etc/ppp/chap-secrets
cat ${config.sops.secrets.pppd-dtagdsl-secrets.path} > /etc/ppp/chap-secrets cat ${config.sops.secrets.pppd-ncfttb-secrets.path} > /etc/ppp/chap-secrets
''; '';
preStartFile = pkgs.writeShellApplication { preStartFile = pkgs.writeShellApplication {
name = "pppd-dtagdsl-pre-start"; name = "pppd-ncfttb-pre-start";
text = preStart; text = preStart;
}; };
in { in {
EnvironmentFile = config.sops.secrets.pppd-dtagdsl-username.path; EnvironmentFile = config.sops.secrets.pppd-ncfttb-username.path;
ExecStartPre = [ ExecStartPre = [
# "+" marks script to be executed without priviledge restrictions # "+" marks script to be executed without priviledge restrictions
"+${lib.getExe preStartFile}" "+${lib.getExe preStartFile}"

View File

@@ -1,21 +1,17 @@
{ {
"wg-monitoring": "ENC[AES256_GCM,data:+k5MgBrj/psMCE1T2jDtCCJI9Q7L+wJ3j83inNkeGp3LSUjoAPtBp4YoyL4=,iv:C19g/Lqi+cWAyiJBMNDtgLc3SDNI9bMBrBPWn+26mVY=,tag:9zIoawuGeGCMbOX1HKR/sQ==,type:str]", "wg-monitoring": "ENC[AES256_GCM,data:+k5MgBrj/psMCE1T2jDtCCJI9Q7L+wJ3j83inNkeGp3LSUjoAPtBp4YoyL4=,iv:C19g/Lqi+cWAyiJBMNDtgLc3SDNI9bMBrBPWn+26mVY=,tag:9zIoawuGeGCMbOX1HKR/sQ==,type:str]",
"pppd-dtagdsl-username": "ENC[AES256_GCM,data:JC7EyyMoN0p5YwnS9W5I0G5Omhk5usw28UiJrCfifGr+2FUgMrtFYAHQdrtWAELvYNBQDPgrHMmQjGQLhpqqK0hH,iv:/q+Fm63GVBApGInyS8i39V/lo6iv+I2omVh47deq+o8=,tag:LkR+1zTDNWuYkhH2iWT7SA==,type:str]", "pppd-ncfttb-username": "ENC[AES256_GCM,data:vyOCNm23xsD3Kj+R7zqnBjH4jEIfYpx/YUUGPcVzqMs9pnFEembahtFTl2sNzOFXLfYCYg==,iv:gMfi/6jldkXCnfdvhu5X1VKj58sVsPR8IX8iEECPfgk=,tag:PJGyIASP6RPAdVULEnn+Gg==,type:str]",
"pppd-dtagdsl-secrets": "ENC[AES256_GCM,data:c5pOb8It1py/9NXNTgLvt9zmsBVbSLHJt4iXWiNA+Osvomw3r7pgoO/JJh9ujomPMnOlDwN7g+pJ,iv:W36gA8E1mWchN6+8hdMdt2epv/RdS91T5ANB/JTcHCE=,tag:7eZ3fZkjERCVJCXYrABnlQ==,type:str]", "pppd-ncfttb-secrets": "ENC[AES256_GCM,data:IEAguET78vdzRo47UvxbDdz+kKgYWVxYakPPu5rNAZ4BCui7DUG3qm2X9bBdHSMA,iv:Q8D58HXkCoVbqwFoYk+dizXNcEP1J63uMaDSNEzfg2g=,tag:R/xG3owmbVDOLM79sfBQjA==,type:str]",
"wg-clerie": "ENC[AES256_GCM,data:OEZg8ZoLAdVhKkvB0ai13ID3gPnVUU/xkOjZ4KiJ9MnRbcFu5HBd7Nw6iNwh,iv:edPuaehya2ZvYKkiBqNUbXVDAxAT6yNgETnWtd6it94=,tag:cX12szdQfAcC6cij6zk6Dw==,type:str]", "wg-clerie": "ENC[AES256_GCM,data:OEZg8ZoLAdVhKkvB0ai13ID3gPnVUU/xkOjZ4KiJ9MnRbcFu5HBd7Nw6iNwh,iv:edPuaehya2ZvYKkiBqNUbXVDAxAT6yNgETnWtd6it94=,tag:cX12szdQfAcC6cij6zk6Dw==,type:str]",
"sops": { "sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [ "age": [
{ {
"recipient": "age16mln27e2p58gu6dpxfclttmuzfnq39mv62kthjpps33g3nl3scfq449857", "recipient": "age16mln27e2p58gu6dpxfclttmuzfnq39mv62kthjpps33g3nl3scfq449857",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3Rkd5WFE3aE5EQzY5ZXV4\nbXVGYmxTdVg1ekRpVjlRUnozY2tMTGloL21RCktjZW95OU9ZZ2owTCtMR1NxaXJn\na2VYS2ttb3VhSjNXOG84UUJtYU04QjAKLS0tIGd3aHM0RldFYnVFdDRVS0Vhc3BF\nckJhYmN6a1FJUC9ibks1cGlRaU1zbFkKE4ClunQ3XGAILwluC6iYFs+rlR02PdhK\njOmPbOlS0aNG0hoC7Z6aetgpj689AkJgl68QVcyvm+ecHH7TOT7l1A==\n-----END AGE ENCRYPTED FILE-----\n" "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3Rkd5WFE3aE5EQzY5ZXV4\nbXVGYmxTdVg1ekRpVjlRUnozY2tMTGloL21RCktjZW95OU9ZZ2owTCtMR1NxaXJn\na2VYS2ttb3VhSjNXOG84UUJtYU04QjAKLS0tIGd3aHM0RldFYnVFdDRVS0Vhc3BF\nckJhYmN6a1FJUC9ibks1cGlRaU1zbFkKE4ClunQ3XGAILwluC6iYFs+rlR02PdhK\njOmPbOlS0aNG0hoC7Z6aetgpj689AkJgl68QVcyvm+ecHH7TOT7l1A==\n-----END AGE ENCRYPTED FILE-----\n"
} }
], ],
"lastmodified": "2024-08-13T14:06:43Z", "lastmodified": "2025-10-24T19:16:49Z",
"mac": "ENC[AES256_GCM,data:yGKY0fi3KQWGHBeyNtQ8EJ6561dKRZ5aAjO9zq3odDtX75i2RSjORIlNjBsVvegBzeo8AkwwnzxNPt2sHl6MKDZfEsysWAi8Wolh4UvHk087AnR/uKvtG6t4uUaNIWej2DEzxUtTQ8QP1afsdqGCf0vZVruNcJ4u2xiQbN2vJPc=,iv:CDXJ5/P+h0Enq/0EL1su1Mw55FVYLy4XPSoUCkRkt+U=,tag:AvRfEDYMBunyIQIVCPbXag==,type:str]", "mac": "ENC[AES256_GCM,data:ADhCQ7JxrEq+5ssevuuQVf3uyHcrcNVSzdT8bkFfDFVEE1hKv8q9QsGxhIaKtv4N2gt079fy0YA+WFKH6H8zWb5ONepH4H/mAek2SYgAtmVsxwdWY13zswsJUPi2CfbaCWOqppb9IiDb8+RCbzY2u/8Qqwk8gx/0uw2hr3IJrhM=,iv:c1/TS+W4pQgh2oPT77LX+dUL929YppRYdZCmMl2yN+M=,tag:fTk1sxdeT9xFjDMhqiHZAg==,type:str]",
"pgp": [ "pgp": [
{ {
"created_at": "2024-05-10T13:05:56Z", "created_at": "2024-05-10T13:05:56Z",
@@ -24,6 +20,6 @@
} }
], ],
"unencrypted_suffix": "_unencrypted", "unencrypted_suffix": "_unencrypted",
"version": "3.8.1" "version": "3.10.2"
} }
} }

View File

@@ -45,13 +45,18 @@
"/mnt/clerie-backup" "/mnt/clerie-backup"
]; ];
doInit = true; doInit = true;
repo = "u275370-sub2@u275370.your-storagebox.de:./clerie-backup/" ; repo = "u275370-sub2@u275370.your-storagebox.de:./clerie-backup/";
encryption = { encryption = {
mode = "none"; mode = "none";
}; };
environment = { BORG_RSH = "ssh -p 23 -i /var/src/secrets/ssh/borg-backup-replication-hetzner"; }; environment = { BORG_RSH = "ssh -p 23 -i /var/src/secrets/ssh/borg-backup-replication-hetzner"; };
compression = "auto,lzma"; compression = "auto,lzma";
startAt = "*-*-* 04:07:00"; startAt = "*-*-* 04:07:00";
readWritePaths = [ "/var/lib/prometheus-node-exporter/textfiles" ];
postPrune = ''
echo "backup_replication_hetzner_last_successful_run_time $(date +%s)" > /var/lib/prometheus-node-exporter/textfiles/backup-replication-hetzner.prom
'';
}; };
}; };

View File

@@ -140,8 +140,37 @@
]; ];
privateKeyFile = config.sops.secrets.wg4719.path; privateKeyFile = config.sops.secrets.wg4719.path;
}; };
# zaphyra
wg1718 = {
ips = [
"fe80::2574/128"
# peer fe80::6b61/64
];
postSetup = ''
ip addr replace dev wg1718 fe80::2574/128 peer fe80::6b61/128
'';
listenPort = 51718;
allowedIPsAsRoutes = false;
peers = [
{
allowedIPs = [ "fe80::/10" "fd00::/8" ];
endpoint = "router-a.dn42.zaphyra.eu:51831";
publicKey = "Knm6uEpMsTfZAK68Pl98mHORtb8TtswBfYFGznpHUCI=";
}
];
privateKeyFile = config.sops.secrets.wg1718.path;
};
}; };
networking.firewall.allowedUDPPorts = [
50565 # wg0565
51271 # wg1271
51272 # wg1272
51280 # wg1280
54719 # wg4719
51718 # wg1718
];
profiles.clerie.dn42-router = { profiles.clerie.dn42-router = {
enable = true; enable = true;
loopbackIp = "fd56:4902:eca0:1::1"; loopbackIp = "fd56:4902:eca0:1::1";
@@ -198,11 +227,17 @@
remoteAsn = "64719"; remoteAsn = "64719";
localAddress = "fe80::1"; localAddress = "fe80::1";
} }
{
peerName = "peer_1718";
remoteAddress = "fe80::6b61";
interfaceName = "wg1718";
remoteAsn = "4242421718";
localAddress = "fe80::2574";
}
]; ];
}; };
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -5,21 +5,18 @@
"wg1272": "ENC[AES256_GCM,data:LU6jtNkNn2Xs+0OH8cD1HJnbHsNNnqlY83lDFa11/dHwVgdFxMtDXMqIMEc=,iv:/A8rWGR6jExa4ms7jTYC0eZVGCvlKw1I58Co41gw3TU=,tag:tIBRkQzFFpEEzflnDrpcOA==,type:str]", "wg1272": "ENC[AES256_GCM,data:LU6jtNkNn2Xs+0OH8cD1HJnbHsNNnqlY83lDFa11/dHwVgdFxMtDXMqIMEc=,iv:/A8rWGR6jExa4ms7jTYC0eZVGCvlKw1I58Co41gw3TU=,tag:tIBRkQzFFpEEzflnDrpcOA==,type:str]",
"wg1280": "ENC[AES256_GCM,data:F4KLY6jiZNl52ko32nM0iTER0DyHvaCSmxeYAKB0MLUD8l9u1Ugk6kYZnUc=,iv:XcaxnvxM1kE/ahNFX+BH7Jmr9q2Py1vHHqOjFUqs5O8=,tag:a1up4gGFqyHz2lmDRJl3bA==,type:str]", "wg1280": "ENC[AES256_GCM,data:F4KLY6jiZNl52ko32nM0iTER0DyHvaCSmxeYAKB0MLUD8l9u1Ugk6kYZnUc=,iv:XcaxnvxM1kE/ahNFX+BH7Jmr9q2Py1vHHqOjFUqs5O8=,tag:a1up4gGFqyHz2lmDRJl3bA==,type:str]",
"wg1302": "ENC[AES256_GCM,data:+MzuBPg3ql0/MEnpVvhQTsPIkKB9xnHN9Fk4VlZwK4ijKl+26d6oTSM7/R0=,iv:bPPmhenQLaKTGaDo4rBlKkrXrS1YysRuntbKq6zi2aQ=,tag:lztaTfDGT4kAq+HZMLl0Dw==,type:str]", "wg1302": "ENC[AES256_GCM,data:+MzuBPg3ql0/MEnpVvhQTsPIkKB9xnHN9Fk4VlZwK4ijKl+26d6oTSM7/R0=,iv:bPPmhenQLaKTGaDo4rBlKkrXrS1YysRuntbKq6zi2aQ=,tag:lztaTfDGT4kAq+HZMLl0Dw==,type:str]",
"wg1718": "ENC[AES256_GCM,data:lB+j2O15O7ogdB+QdutD3V/h8IREMMlpCsnMJWNPXlz196KM6WNNYCV2v5M=,iv:AwrRPQIFu8A14Vs5A9slkCPMkgU3VZxL1YupJnriEHc=,tag:Vpt0C6SFzUXGotdfc1ocmg==,type:str]",
"wg4719": "ENC[AES256_GCM,data:hoOOCUGdYFaAQZ6wkgmQl65M1qArvXa826IeJl+BUGf7UX0vxx9J0C2epTE=,iv:+1JcOgzClehkE0Ihd2mmoenPk51OBZMF0bMqapWah/c=,tag:xI5FU+GJU6BER9/n04ccLA==,type:str]", "wg4719": "ENC[AES256_GCM,data:hoOOCUGdYFaAQZ6wkgmQl65M1qArvXa826IeJl+BUGf7UX0vxx9J0C2epTE=,iv:+1JcOgzClehkE0Ihd2mmoenPk51OBZMF0bMqapWah/c=,tag:xI5FU+GJU6BER9/n04ccLA==,type:str]",
"wg-monitoring": "ENC[AES256_GCM,data:aw11Ygfll6llabXkuxtbTcCn1eb4NZX1IwArcXoRJCJSgwDrQZ3HLatov3w=,iv:J2VD5XS+BrIKeFb0NW1UYZUuGPkbjFmooZ93PVK31gw=,tag:2XLSa/2s6LRq3L7UdrTs/g==,type:str]", "wg-monitoring": "ENC[AES256_GCM,data:aw11Ygfll6llabXkuxtbTcCn1eb4NZX1IwArcXoRJCJSgwDrQZ3HLatov3w=,iv:J2VD5XS+BrIKeFb0NW1UYZUuGPkbjFmooZ93PVK31gw=,tag:2XLSa/2s6LRq3L7UdrTs/g==,type:str]",
"sops": { "sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [ "age": [
{ {
"recipient": "age1f0hscql4f4w7vyukzeu693xfedsl596dpjekc23q77ylp92zsvcqf9u75t", "recipient": "age1f0hscql4f4w7vyukzeu693xfedsl596dpjekc23q77ylp92zsvcqf9u75t",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3QWdFYjFjTmRVRlV3U3p4\nTSsyc1E0dWtiYjNtVkV2SXJEWkxnTDhLN1Y0Cng4aGlidjhydUVGaFcvK215aGdq\nN0FGajYwa1lPUCsva0tmNkErUGtlOWsKLS0tIG9pLzJEUDA2WWUzd1kzSVZrdVRX\nbUxjQzBCd3p0R1dWTTJaRmZNQjJEUVkKPz6OUQHpYrhRxMdQzpZRR3exVqkG2JvX\nI32PwvbeQK8cgpYwKLGar8U8aiPPm0Y64pID1wedDsNZzLqLOrS3wQ==\n-----END AGE ENCRYPTED FILE-----\n" "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3QWdFYjFjTmRVRlV3U3p4\nTSsyc1E0dWtiYjNtVkV2SXJEWkxnTDhLN1Y0Cng4aGlidjhydUVGaFcvK215aGdq\nN0FGajYwa1lPUCsva0tmNkErUGtlOWsKLS0tIG9pLzJEUDA2WWUzd1kzSVZrdVRX\nbUxjQzBCd3p0R1dWTTJaRmZNQjJEUVkKPz6OUQHpYrhRxMdQzpZRR3exVqkG2JvX\nI32PwvbeQK8cgpYwKLGar8U8aiPPm0Y64pID1wedDsNZzLqLOrS3wQ==\n-----END AGE ENCRYPTED FILE-----\n"
} }
], ],
"lastmodified": "2024-04-28T09:28:04Z", "lastmodified": "2025-06-10T20:51:10Z",
"mac": "ENC[AES256_GCM,data:PHdhyie0Ya/nN9Kqj4z+zPyyKZFvGkznkv8Uf3LNSdPKWVtXARZc8Xodm4MjI2HvooryyyMFHkW75Aln02Rlvk3R8oI7rfFZC7s2P+LotumsYgRFf0JOUMxsxOtKW0ehuLy83Bw0rMJQo1gzTgBykcvdc2pkMmALF/vU/1VqgJ4=,iv:0JwcY0Q+8VAiVHYjynhcpsobQXOkK8EBe3QUJ8YUwFE=,tag:9xAcoxAPGxTvHVBydf3u9Q==,type:str]", "mac": "ENC[AES256_GCM,data:9lF4HV0oJyGHXdtYdMxR7+ev7JLAQVr6kE55nLoZcrbC92MHJzQpgM9XAhIynvwdAmC7ARd3orCn6eYkQJDdNX0JjMtebsBE+H4B7mEUCz8wtTN0iHS+oHmQxrqjnoSw2uHh9udgqAJa+sd6VGU3t2XUuuKtVHPwzROqVgvas9M=,iv:KT+BlFeXGZQc5pbBX+XOsmKEydUtir1LuPvseDkFeqw=,tag:hlRskY6b5EAZkUYs7ph/JA==,type:str]",
"pgp": [ "pgp": [
{ {
"created_at": "2024-04-28T09:25:37Z", "created_at": "2024-04-28T09:25:37Z",
@@ -28,6 +25,6 @@
} }
], ],
"unencrypted_suffix": "_unencrypted", "unencrypted_suffix": "_unencrypted",
"version": "3.8.1" "version": "3.10.2"
} }
} }

View File

@@ -111,8 +111,7 @@
''; '';
}; };
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
startAt = "*-*-* 06:22:00"; startAt = "*-*-* 06:22:00";
}; };

View File

@@ -105,8 +105,7 @@
''; '';
}; };
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
startAt = "*-*-* 07:22:00"; startAt = "*-*-* 07:22:00";
}; };

View File

@@ -161,8 +161,7 @@
} }
''; '';
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -70,8 +70,7 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -131,6 +131,7 @@
clerie.nginx-port-forward = { clerie.nginx-port-forward = {
enable = true; enable = true;
resolver = "127.0.0.53";
tcpPorts."443" = { tcpPorts."443" = {
host = "localhost"; host = "localhost";
port = 22; port = 22;

View File

@@ -5,8 +5,6 @@
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../../configuration/desktop
./android.nix ./android.nix
./backup.nix ./backup.nix
./etesync-dav.nix ./etesync-dav.nix
@@ -15,6 +13,8 @@
./programs.nix ./programs.nix
]; ];
profiles.clerie.desktop.enable = true;
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View File

@@ -11,17 +11,21 @@
signal-desktop signal-desktop
dino dino
fractal fractal
tuba
flare-signal
tio tio
xournalpp xournalpp
onlyoffice-bin libreoffice
krita krita
inkscape inkscape
dune3d
wireshark wireshark
tcpdump tcpdump
nmap nmap
pkgs."http.server"
kdePackages.okular kdePackages.okular
chromium-incognito chromium-incognito

View File

@@ -25,6 +25,48 @@
fail_if_not_ssl: true fail_if_not_ssl: true
fail_if_body_not_matches_regexp: fail_if_body_not_matches_regexp:
- "Synapse is running" - "Synapse is running"
headers:
User-Agent: "monitoring.clerie.de, blackbox exporter"
http4:
prober: http
http:
preferred_ip_protocol: ip4
ip_protocol_fallback: false
fail_if_ssl: true
follow_redirects: false
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
headers:
User-Agent: "monitoring.clerie.de, blackbox exporter"
http6:
prober: http
http:
preferred_ip_protocol: ip6
ip_protocol_fallback: false
fail_if_ssl: true
follow_redirects: false
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
headers:
User-Agent: "monitoring.clerie.de, blackbox exporter"
https4:
prober: http
http:
preferred_ip_protocol: ip4
ip_protocol_fallback: false
fail_if_not_ssl: true
follow_redirects: false
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
headers:
User-Agent: "monitoring.clerie.de, blackbox exporter"
https6:
prober: http
http:
preferred_ip_protocol: ip6
ip_protocol_fallback: false
fail_if_not_ssl: true
follow_redirects: false
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
headers:
User-Agent: "monitoring.clerie.de, blackbox exporter"
''; '';
}; };
} }

View File

@@ -10,6 +10,7 @@
./grafana.nix ./grafana.nix
./nixos-validator.nix ./nixos-validator.nix
./prometheus.nix ./prometheus.nix
./targets.nix
./uptimestatus.nix ./uptimestatus.nix
]; ];

View File

@@ -0,0 +1,77 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 10,
"links": [],
"panels": [
{
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"includeVars": false,
"keepTime": false,
"maxItems": 10,
"query": "",
"showFolderNames": true,
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": []
},
"pluginVersion": "12.0.2+security-01",
"title": "Dashboards",
"type": "dashlist"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"hidden": true
},
"timezone": "browser",
"title": "Home",
"uid": "OqTN9p2nz",
"version": 1
}

View File

@@ -0,0 +1,355 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 16,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(server_name) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Total requests",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 12,
"x": 12,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(server_name, method) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "{{server_name}}: {{method}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Status codes",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 12,
"x": 0,
"y": 10
},
"id": 3,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(server_name, status) (rate(nginxlog_http_response_count_total{server_name=~\"$server_name\"}[5m]))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "{{server_name}}: HTTP {{status}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Response codes",
"type": "timeseries"
}
],
"preload": false,
"refresh": "30s",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "All",
"value": [
"$__all"
]
},
"definition": "label_values(nginxlog_http_response_count_total,server_name)",
"includeAll": true,
"label": "vHost",
"multi": true,
"name": "server_name",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(nginxlog_http_response_count_total,server_name)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
}
]
},
"time": {
"from": "now-3h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "Nginx Exporter",
"uid": "b042a880-3cb0-4dd3-ae48-4745a58af698",
"version": 7
}

View File

@@ -0,0 +1,135 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 15,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-RdYlGr"
},
"custom": {
"axisPlacement": "auto",
"fillOpacity": 70,
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineWidth": 0,
"spanNulls": false
},
"mappings": [
{
"options": {
"0": {
"index": 1,
"text": "mismatch"
},
"1": {
"index": 0,
"text": "sync"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red"
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 23,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"alignValue": "left",
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "auto",
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "builder",
"expr": "nixos_current_system_is_sync",
"legendFormat": "{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Config is Sync",
"type": "state-timeline"
}
],
"preload": false,
"refresh": "5m",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "NixOS Status",
"uid": "W4j3nz1Vz",
"version": 3
}

View File

@@ -0,0 +1,211 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 11,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 22,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.0.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"exemplar": true,
"expr": "probe_icmp_duration_seconds{job=\"blackbox_icmp6\", target=~\"$target\", instance=~\"$instance\", phase=\"rtt\"} > 0 ",
"interval": "",
"legendFormat": "IPv6 {{target}} ({{instance}})",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"exemplar": true,
"expr": "probe_icmp_duration_seconds{job=\"blackbox_icmp4\", target=~\"$target\", instance=~\"$instance\", phase=\"rtt\"} > 0",
"hide": false,
"interval": "",
"legendFormat": "IPv4 {{target}} ({{instance}})",
"range": true,
"refId": "B"
}
],
"title": "Smokeping",
"type": "timeseries"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, target)",
"includeAll": true,
"label": "Target:",
"multi": true,
"name": "target",
"options": [],
"query": {
"query": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, target)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"definition": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, instance)",
"includeAll": true,
"label": "Instance:",
"multi": true,
"name": "instance",
"options": [],
"query": {
"query": "label_values(probe_icmp_duration_seconds{phase=\"rtt\"}, instance)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"type": "query"
}
]
},
"time": {
"from": "now-30m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Smokeping",
"uid": "IytTVZL7z",
"version": 9
}

View File

@@ -52,6 +52,12 @@ let
attrByPath ["clerie" "monitoring" "blackbox"] false host.config) attrByPath ["clerie" "monitoring" "blackbox"] false host.config)
monitoringHosts); monitoringHosts);
nginxlogMonitoringTargets = mapAttrsToList (name: host:
"${host.config.networking.hostName}.mon.clerie.de:9117")
(filterAttrs (name: host:
attrByPath ["services" "prometheus" "exporters" "nginxlog" "enable"] false host.config)
monitoringHosts);
eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b)))); eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b))));
in { in {
@@ -104,6 +110,21 @@ in {
relabelAddressToInstance relabelAddressToInstance
]; ];
} }
{
job_name = "alertmanager";
scrape_interval = "20s";
scheme = "http";
static_configs = [
{
targets = [
"monitoring-3.mon.clerie.de:9093"
];
}
];
relabel_configs = [
relabelAddressToInstance
];
}
{ {
job_name = "node-exporter"; job_name = "node-exporter";
scrape_interval = "20s"; scrape_interval = "20s";
@@ -141,10 +162,7 @@ in {
}; };
static_configs = [ static_configs = [
{ {
targets = [ targets = map (target: "${target};infra") config.profiles.clerie.monitoring-server.probeTargets.node-exporter-uberspace;
"clerie.uber.space;infra"
"cleriewi.uber.space;infra"
];
} }
]; ];
relabel_configs = [ relabel_configs = [
@@ -225,17 +243,7 @@ in {
}; };
static_configs = [ static_configs = [
{ {
targets = eachWithEachOther (instance: target: "${instance};${target}") blackboxMonitoringTargets [ targets = eachWithEachOther (instance: target: "${instance};${target}") blackboxMonitoringTargets config.profiles.clerie.monitoring-server.probeTargets.blackbox-icmp6;
"clerie.de"
"tagesschau.de"
"google.com"
"achtbaan.nikhef.nl"
"fluorine.net.clerie.de"
"www.fem.tu-ilmenau.de"
"www.heise.de"
"dyon.net.entr0py.de"
"matrix.fachschaften.org"
];
} }
]; ];
relabel_configs = [ relabel_configs = [
@@ -267,18 +275,7 @@ in {
}; };
static_configs = [ static_configs = [
{ {
targets = eachWithEachOther (instance: target: "${instance};${target}") blackboxMonitoringTargets [ targets = eachWithEachOther (instance: target: "${instance};${target}") blackboxMonitoringTargets config.profiles.clerie.monitoring-server.probeTargets.blackbox-icmp4;
"clerie.de"
"tagesschau.de"
"google.com"
"achtbaan.nikhef.nl"
"www.fem.tu-ilmenau.de"
"www.heise.de"
"matrix.bau-ha.us"
"dyon.net.entr0py.de"
"matrix.entr0py.de"
"matrix.fachschaften.org"
];
} }
]; ];
relabel_configs = [ relabel_configs = [
@@ -310,10 +307,7 @@ in {
}; };
static_configs = [ static_configs = [
{ {
targets = [ targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-synapse;
"matrix.entr0py.de"
"matrix.fachschaften.org"
];
} }
]; ];
relabel_configs = [ relabel_configs = [
@@ -393,6 +387,122 @@ in {
relabelAddressToInstance relabelAddressToInstance
]; ];
} }
{
job_name = "blackbox_local_http6";
scrape_interval = "100s";
metrics_path = "/probe";
params = {
module = [ "http6" ];
};
static_configs = [
{
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http6;
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
replacement = "http://\${1}";
}
{
source_labels = [ "__address__" ];
target_label = "target";
}
{
target_label = "__address__";
replacement = "monitoring-3.mon.clerie.de:9115";
}
relabelAddressToInstance
];
}
{
job_name = "blackbox_local_http4";
scrape_interval = "100s";
metrics_path = "/probe";
params = {
module = [ "http4" ];
};
static_configs = [
{
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http4;
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
replacement = "http://\${1}";
}
{
source_labels = [ "__address__" ];
target_label = "target";
}
{
target_label = "__address__";
replacement = "monitoring-3.mon.clerie.de:9115";
}
relabelAddressToInstance
];
}
{
job_name = "blackbox_local_https6";
scrape_interval = "100s";
metrics_path = "/probe";
params = {
module = [ "https6" ];
};
static_configs = [
{
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http6;
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
replacement = "https://\${1}";
}
{
source_labels = [ "__address__" ];
target_label = "target";
}
{
target_label = "__address__";
replacement = "monitoring-3.mon.clerie.de:9115";
}
relabelAddressToInstance
];
}
{
job_name = "blackbox_local_https4";
scrape_interval = "100s";
metrics_path = "/probe";
params = {
module = [ "https4" ];
};
static_configs = [
{
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http4;
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
replacement = "https://\${1}";
}
{
source_labels = [ "__address__" ];
target_label = "target";
}
{
target_label = "__address__";
replacement = "monitoring-3.mon.clerie.de:9115";
}
relabelAddressToInstance
];
}
{ {
job_name = "hydra"; job_name = "hydra";
scrape_interval = "20s"; scrape_interval = "20s";
@@ -432,12 +542,24 @@ in {
} }
]; ];
} }
{
job_name = "nginxlog-exporter";
scrape_interval = "20s";
static_configs = [
{
targets = nginxlogMonitoringTargets;
}
];
relabel_configs = [
relabelAddressToInstance
];
}
]; ];
alertmanagers = [ alertmanagers = [
{ {
static_configs = [ { static_configs = [ {
targets = [ targets = [
"[::1]:9093" "monitoring-3.mon.clerie.de:9093"
]; ];
} ]; } ];
} }

View File

@@ -18,7 +18,7 @@ groups:
summary: "Current system of {{ $labels.instance }} not in sync with config" summary: "Current system of {{ $labels.instance }} not in sync with config"
description: "The current system hash of {{ $labels.instance }} does not match the one generated by hydra based on the current config" description: "The current system hash of {{ $labels.instance }} does not match the one generated by hydra based on the current config"
- alert: StorageFull - alert: StorageFull
expr: ((last_over_time(node_filesystem_avail_bytes{job="node-exporter"}[5m]) / last_over_time(node_filesystem_size_bytes{job="node-exporter"}[5m])) * 100) < 5 expr: ((last_over_time(node_filesystem_avail_bytes{job="node-exporter", mountpoint!="/nix/store"}[5m]) / last_over_time(node_filesystem_size_bytes{job="node-exporter", mountpoint!="/nix/store"}[5m])) * 100) < 5
for: 30m for: 30m
labels: labels:
severity: critical severity: critical
@@ -26,7 +26,7 @@ groups:
summary: "Storage of {{ $labels.instance }} is full" summary: "Storage of {{ $labels.instance }} is full"
description: "Storage of {{ $labels.instance }} for {{ $labels.mountpoint }} on {{ $labels.device }} is full" description: "Storage of {{ $labels.instance }} for {{ $labels.mountpoint }} on {{ $labels.device }} is full"
- alert: StorageAlmostFull - alert: StorageAlmostFull
expr: ((last_over_time(node_filesystem_avail_bytes{job="node-exporter"}[5m]) / last_over_time(node_filesystem_size_bytes{job="node-exporter"}[5m])) * 100) < 10 expr: ((last_over_time(node_filesystem_avail_bytes{job="node-exporter", mountpoint!="/nix/store"}[5m]) / last_over_time(node_filesystem_size_bytes{job="node-exporter", mountpoint!="/nix/store"}[5m])) * 100) < 10
for: 30m for: 30m
labels: labels:
severity: warning severity: warning
@@ -87,3 +87,26 @@ groups:
annotations: annotations:
summary: "GPG {{ $labels.fingerprint }} is expiring soon" summary: "GPG {{ $labels.fingerprint }} is expiring soon"
description: "GPG with fingerprint {{ $labels.fingerprint }} is expiring in less then six weeks" description: "GPG with fingerprint {{ $labels.fingerprint }} is expiring in less then six weeks"
- alert: NadjaTopIPv4ProxyBroken
expr: probe_success{job="blackbox_local_http6", target="blog.nadja.top"} != on (target) probe_success{job="blackbox_local_http4", target="blog.nadja.top"}
for: 15m
labels:
severity: critical
annotations:
summary: "blog.nadja.top unreachable via IPv4"
description: "blog.nadja.top unreachable IPv4, but reachable via IPv6"
- alert: AlertmanagerNotificationRequestsFailed
expr: rate(alertmanager_notification_requests_failed_total[5m]) > 0
labels:
severity: critical
annotations:
summary: "Too many notification requests failed"
description: "Too many notification requests to Alertmanager integration {{ $labels.integration }} failed"
- alert: FemSocialDown
expr: min(probe_success{target="fem.social", job=~"blackbox_local_http.*"}) == 0
for: 5m
labels:
severity: critical
annotations:
summary: "fem.social unavailable via HTTP"
description: "fem.social is not fully reachable via HTTP"

View File

@@ -0,0 +1,7 @@
{ ... }:
{
profiles.clerie.monitoring-server.targets = builtins.fromJSON (builtins.readFile ../../monitoring/targets.json);
}

View File

@@ -41,8 +41,7 @@
networking.firewall.allowedUDPPorts = []; networking.firewall.allowedUDPPorts = [];
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -26,8 +26,29 @@
ipv6AcceptRAConfig.DHCPv6Client = "no"; ipv6AcceptRAConfig.DHCPv6Client = "no";
}; };
profiles.clerie.common-webserver.httpDefaultVirtualHost = false;
services.unbound = {
enable = true;
resolveLocalQueries = false;
settings = {
server = {
interface = [ "127.0.0.1" ];
};
};
};
clerie.nginx-port-forward = { clerie.nginx-port-forward = {
enable = true; enable = true;
resolver = "127.0.0.1";
tcpPorts."80" = {
host = "baikonur.dyn.weimarnetz.de";
port = 80;
};
tcpPorts."443" = {
host = "baikonur.dyn.weimarnetz.de";
port = 443;
};
tcpPorts."2022" = { tcpPorts."2022" = {
host = "nonat.net.clerie.de"; host = "nonat.net.clerie.de";
port = 22; port = 22;
@@ -37,6 +58,10 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = []; networking.firewall.allowedUDPPorts = [];
services.bijwerken = {
autoUpgrade = true;
};
clerie.monitoring = { clerie.monitoring = {
enable = true; enable = true;
id = "102"; id = "102";

View File

@@ -52,8 +52,7 @@
}; };
}; };
clerie.system-auto-upgrade = { services.bijwerken = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -11,7 +11,28 @@ with lib;
}; };
users.groups.data-em = {}; users.groups.data-em = {};
users.users.data-em-mp3 = {
group = "data-em-mp3";
home = "/data/em-mp3";
useDefaultShell = true;
isSystemUser = true;
};
users.groups.data-em-mp3 = {};
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /data/em - data-em data-em - -" "d /data/em - data-em data-em - -"
"d /data/em-mp3 - data-em-mp3 data-em-mp3 - -"
]; ];
systemd.services.convert-flac-dir-to-mp3 = {
serviceConfig = {
Type = "oneshot";
ExecStart = "${lib.getExe pkgs.convert-flac-dir-to-mp3} /data/em /data/em-mp3";
StateDirectory = "convert-flac-dir-to-mp3";
WorkingDirectory = "/var/lib/convert-flac-dir-to-mp3";
User = "data-em-mp3";
Group = "data-em-mp3";
};
startAt = "*-*-* 03:47:00";
};
} }

View File

@@ -53,17 +53,23 @@ in {
"mixcloud.clerie.de" = { "mixcloud.clerie.de" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
locations."/" = { locations."/" = {
alias = "/data/mixcloud/"; alias = "/data/mixcloud/";
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
extraConfig = '' extraConfig = ''
autoindex on; autoindex on;
autoindex_exact_size off; autoindex_exact_size off;
''; '';
}; };
locations."/api/" = {
alias = "/data/mixcloud/";
extraConfig = ''
autoindex on;
autoindex_format json;
'';
};
locations."/media/" = { locations."/media/" = {
alias = "/data/media/"; alias = "/data/media/";
basicAuthFile = config.sops.secrets.mixcloud-htpasswd.path;
extraConfig = '' extraConfig = ''
autoindex on; autoindex on;
autoindex_exact_size off; autoindex_exact_size off;

View File

@@ -0,0 +1,195 @@
ip6tables -I nixos-fw -s 2400:3200::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2400:3200:baba::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2400:b200:4100::/46 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2401:8680:4100::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2401:b180:4100::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2404:2280:1000::/36 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2404:2280:2000::/35 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2404:2280:4000::/36 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2408:4000:1000::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 2408:4009:500::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4000::/31 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4002::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4004::/31 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4006::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4006:1000::/43 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4006:1020::/44 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4007::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4009::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:400b::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:400c::/30 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4011::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4012::/48 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4013::/32 -j nixos-fw-refuse
ip6tables -I nixos-fw -s 240b:4014::/32 -j nixos-fw-refuse
iptables -I nixos-fw -s 5.181.224.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.208.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.0.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.36.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.40.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.48.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.64.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.209.128.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.210.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.212.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.213.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.213.128.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.213.160.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.213.176.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.213.192.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.214.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.216.0.0/14 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.220.64.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.220.128.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.221.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 8.222.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 14.1.112.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.91.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.1.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.2.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.4.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.7.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.8.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.17.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.19.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.20.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.24.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.27.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.28.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.32.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.40.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.52.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.56.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.58.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.66.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.68.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.72.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.78.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.80.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.84.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.86.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.88.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.96.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.100.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.102.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.104.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.96.106.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.98.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.100.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.102.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.103.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.104.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 43.108.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 45.196.28.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 45.199.179.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.52.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.56.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.74.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.76.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.0.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.16.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.24.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.32.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.64.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.96.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.77.128.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.78.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.79.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.79.128.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.79.192.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.80.0.0/14 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.84.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.86.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.87.0.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.87.128.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.87.192.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.87.224.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.87.232.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.88.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.0.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.72.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.80.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.84.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.88.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.96.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.122.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.124.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.89.128.0/17 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.90.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.235.0.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.235.8.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.235.12.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.235.16.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.236.0.0/14 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.240.0.0/14 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.244.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.32.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.66.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.68.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.72.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.80.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.82.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.84.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.88.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.92.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.96.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.120.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.122.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.124.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.128.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.144.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.150.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.152.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.160.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.246.192.0/21 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.250.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.252.0.0/15 -j nixos-fw-refuse
iptables -I nixos-fw -s 47.254.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 59.82.136.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 103.81.186.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 110.76.21.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 110.76.23.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 116.251.64.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 139.95.0.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 139.95.16.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 139.95.64.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 140.205.1.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 140.205.122.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 147.139.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 149.129.0.0/20 -j nixos-fw-refuse
iptables -I nixos-fw -s 149.129.16.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 149.129.32.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 149.129.64.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 149.129.192.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 156.227.20.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 156.236.12.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 156.236.17.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 156.240.76.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 156.245.1.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 161.117.0.0/16 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.24.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.29.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.30.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.32.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.64.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.66.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.68.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.72.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.76.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.80.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.84.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.86.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.88.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.90.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.92.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.104.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.136.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 170.33.138.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 185.78.106.0/23 -j nixos-fw-refuse
iptables -I nixos-fw -s 198.11.128.0/18 -j nixos-fw-refuse
iptables -I nixos-fw -s 202.144.199.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 203.107.64.0/22 -j nixos-fw-refuse
iptables -I nixos-fw -s 203.107.68.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 205.204.96.0/19 -j nixos-fw-refuse
iptables -I nixos-fw -s 223.5.5.0/24 -j nixos-fw-refuse
iptables -I nixos-fw -s 223.6.6.0/24 -j nixos-fw-refuse

View File

@@ -27,7 +27,7 @@
root = pkgs.clerie-keys; root = pkgs.clerie-keys;
}; };
locations."= /ssh/known_hosts" = { locations."= /ssh/known_hosts" = {
alias = pkgs.writeText "known_hosts" (import ../../lib/ssh-known-hosts.nix); alias = pkgs.clerie-ssh-known-hosts + "/known_hosts";
extraConfig = '' extraConfig = ''
types { } types { }
default_type "text/plain; charset=utf-8"; default_type "text/plain; charset=utf-8";
@@ -53,9 +53,6 @@
''; '';
return = "200 ''"; return = "200 ''";
}; };
extraConfig = ''
access_log /var/log/nginx/clerie.de.log combined_anon;
'';
}; };
}; };
} }

View File

@@ -24,6 +24,7 @@
./public.nix ./public.nix
./radicale.nix ./radicale.nix
./reichartstrasse.nix ./reichartstrasse.nix
./traveldrafter.nix
./uptimestatus.nix ./uptimestatus.nix
./wetter.nix ./wetter.nix
]; ];
@@ -51,6 +52,8 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.extraCommands = builtins.readFile ./blocked-prefixes.txt;
services.postgresql = { services.postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_16; package = pkgs.postgresql_16;

View File

@@ -83,9 +83,6 @@
proxyPass = "http://[::1]:3000"; proxyPass = "http://[::1]:3000";
}; };
}; };
extraConfig = ''
access_log /var/log/nginx/git.clerie.de.log combined_anon;
'';
}; };
}; };
} }

View File

@@ -53,9 +53,6 @@
types { } default_type "text/html; charset=utf-8"; types { } default_type "text/html; charset=utf-8";
''; '';
}; };
extraConfig = ''
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
'';
}; };
"ip4.clerie.de" = { "ip4.clerie.de" = {
enableACME = true; enableACME = true;
@@ -67,9 +64,6 @@
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
''; '';
}; };
extraConfig = ''
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
'';
}; };
"ip6.clerie.de" = { "ip6.clerie.de" = {
enableACME = true; enableACME = true;
@@ -81,9 +75,6 @@
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
''; '';
}; };
extraConfig = ''
access_log /var/log/nginx/ip.clerie.de.log vcombined_anon;
'';
}; };
}; };
} }

View File

@@ -7,8 +7,8 @@
forceSSL = true; forceSSL = true;
root = pkgs.fetchgit { root = pkgs.fetchgit {
url = "https://git.clerie.de/clerie/legal.clerie.de.git"; url = "https://git.clerie.de/clerie/legal.clerie.de.git";
rev = "c6900226e3107a2e370a32759d83db472ab5450d"; rev = "b271b9729f4545c340ce9d16ecbca136031da409";
sha256 = "sha256-lOjbHqYc/85rjotwQ5Oj+MSWnDIfLx2w5mpiJkChbXU="; sha256 = "sha256-uw69o7LxK+JF1AojSyusU1urshBc63Bgva5lRBgQdKc=";
}; };
locations."/impressum" = { locations."/impressum" = {
return = ''301 https://legal.clerie.de/#impressum''; return = ''301 https://legal.clerie.de/#impressum'';

View File

@@ -4,19 +4,16 @@
"clerie-backup-target-magenta": "ENC[AES256_GCM,data:zsPFXpnTWHL2b9/fZiW1fhpla8hTeZb1+O8oihnwDIAcC4Tgn8PrFDEYK7kuWYcdbIvL5XRJRR48erSACsntFA==,iv:lTlAyVl3ndgca4Mp9lSldXmhlP8ECPvE/CM7Zpzy9ao=,tag:LCNF1loABQpZ8Y5wfpXjkg==,type:str]", "clerie-backup-target-magenta": "ENC[AES256_GCM,data:zsPFXpnTWHL2b9/fZiW1fhpla8hTeZb1+O8oihnwDIAcC4Tgn8PrFDEYK7kuWYcdbIvL5XRJRR48erSACsntFA==,iv:lTlAyVl3ndgca4Mp9lSldXmhlP8ECPvE/CM7Zpzy9ao=,tag:LCNF1loABQpZ8Y5wfpXjkg==,type:str]",
"wg-monitoring": "ENC[AES256_GCM,data:AfkytaHshFSyKkMdKVMdYaq3sKUC9dKYs5rKXN4Ouv5kjDGNXC18liEsRuc=,iv:4mMgsovdAJ++Myr+9GuhAaEBuzDBNZbGK6zfzoAEJ0E=,tag:/d0ZXNbpaMFyxyzov23kdQ==,type:str]", "wg-monitoring": "ENC[AES256_GCM,data:AfkytaHshFSyKkMdKVMdYaq3sKUC9dKYs5rKXN4Ouv5kjDGNXC18liEsRuc=,iv:4mMgsovdAJ++Myr+9GuhAaEBuzDBNZbGK6zfzoAEJ0E=,tag:/d0ZXNbpaMFyxyzov23kdQ==,type:str]",
"radicale-htpasswd": "ENC[AES256_GCM,data:+FHsq5We/fc8gBNub/GV5Mfs2i0/7Qm9UPDhb3unEhak6XDAvMSUQb4eaX0wn7Yi3y/gFGmapd0eYilTjfoJnI9gVnvi,iv:lEV8kQh9RBL/xKcCLIRzUR6ADq4zoah1c8Z67Qrs3dQ=,tag:cw6jKYbZUXBD3Zio5CH+Hw==,type:str]", "radicale-htpasswd": "ENC[AES256_GCM,data:+FHsq5We/fc8gBNub/GV5Mfs2i0/7Qm9UPDhb3unEhak6XDAvMSUQb4eaX0wn7Yi3y/gFGmapd0eYilTjfoJnI9gVnvi,iv:lEV8kQh9RBL/xKcCLIRzUR6ADq4zoah1c8Z67Qrs3dQ=,tag:cw6jKYbZUXBD3Zio5CH+Hw==,type:str]",
"traveldrafter-htpasswd": "ENC[AES256_GCM,data:f29vVDofv2mJEyn/pMKWW8ZbVTKSofe1EEtcfuCaokdqAyxemcq/2hrXFw8cAGTV2hwVqlM2hzJcT32KBjO/wgUNfv4=,iv:5PdQ+bn/bXmfQstP5A/dLeDk7O0qTjoRTyr4D+AgiG0=,tag:gCBrSJ4cEnZHqePiUpPglA==,type:str]",
"sops": { "sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [ "age": [
{ {
"recipient": "age1nn8dwl2avshdhwn66w92jvlvz2ugl5fdxc8dxz6lpru72hlq44uq5a88az", "recipient": "age1nn8dwl2avshdhwn66w92jvlvz2ugl5fdxc8dxz6lpru72hlq44uq5a88az",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlU2tEMHIvRUFxa24wMVcy\nb2lheGR2ekl6S0wzWUd5cTMwTC9HdFN1eVc0CkRjRHdJVUw3ZCtZSTlUOHZCV2J6\nYkxqdnNmU05LTTNmNFZiTzBxZVdkOTgKLS0tIEZUZ0svL2NhcTZPdFZrYUhwQ05Q\nWnZXRWIvRXBOMWNDTzQ4RDNKa3IwSUkKj+vI9dEEUQYN9uT6H1FdexComfbe+iA9\nVzLF970ASzptGiNYtdN9GYdXY7JGHoOfmYy3fpjZGN3p2KqiYyi3UA==\n-----END AGE ENCRYPTED FILE-----\n" "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlU2tEMHIvRUFxa24wMVcy\nb2lheGR2ekl6S0wzWUd5cTMwTC9HdFN1eVc0CkRjRHdJVUw3ZCtZSTlUOHZCV2J6\nYkxqdnNmU05LTTNmNFZiTzBxZVdkOTgKLS0tIEZUZ0svL2NhcTZPdFZrYUhwQ05Q\nWnZXRWIvRXBOMWNDTzQ4RDNKa3IwSUkKj+vI9dEEUQYN9uT6H1FdexComfbe+iA9\nVzLF970ASzptGiNYtdN9GYdXY7JGHoOfmYy3fpjZGN3p2KqiYyi3UA==\n-----END AGE ENCRYPTED FILE-----\n"
} }
], ],
"lastmodified": "2024-05-10T13:32:34Z", "lastmodified": "2025-07-06T16:08:39Z",
"mac": "ENC[AES256_GCM,data:lxfYT2TEO9KFx0x6DPRQ2mRy5Ft6syyyO1yV9my6GwvDxd1e7odXGRcFo3N1AFod8Y6z4+XaxqZ/GoqSp94Pk8aF4eEhyAFun/UUr8KhKGsnq6xnQA4p37oYccvTY4eohS5YHBr/+AMutddmQ7qiYtQhVViXAr6+dmOsV1Tfu+A=,iv:bC+z9SP2W048bR3aWIcPgRlfLB5n5ccst6OvH0NjYBk=,tag:qhoXUAl0nG4LYy6yXQP2/g==,type:str]", "mac": "ENC[AES256_GCM,data:6EbMSJAKOMgXtlwaVtsmPgrZVgraReAfVJWjZvhe965eLhhP5aeyZqPlA6a93h2FsShVFYWFPI57tdHy9Ymo53oXolSt8Docr2w2FL4BTWHHhkXal9+6aJZAZ+XOPEOUYurFxPOX44l+LDkecSz0NMCgrScWtpphjlkj3yP5GTo=,iv:5w8RC9IAuyEuO0QSZ0FBwW2/qqV56HNG7hZIkEeGEYU=,tag:Zosv1OSMtznnKkSYStu+oA==,type:str]",
"pgp": [ "pgp": [
{ {
"created_at": "2024-05-10T13:29:58Z", "created_at": "2024-05-10T13:29:58Z",
@@ -27,4 +24,4 @@
"unencrypted_suffix": "_unencrypted", "unencrypted_suffix": "_unencrypted",
"version": "3.8.1" "version": "3.8.1"
} }
} }

View File

@@ -0,0 +1,40 @@
{ pkgs, lib, config, ... }: {
services.update-from-hydra.paths.traveldrafter = {
enable = true;
hydraUrl = "https://hydra.clerie.de";
hydraProject = "clerie";
hydraJobset = "traveldrafter";
hydraJob = "packages.x86_64-linux.traveldrafter";
nixStoreUri = "https://nix-cache.clerie.de";
resultPath = "/srv/traveldrafter";
};
sops.secrets.traveldrafter-htpasswd = {
owner = "nginx";
group = "nginx";
};
services.nginx.virtualHosts = {
"traveldrafter.clerie.de" = {
enableACME = true;
forceSSL = true;
root = "/srv/traveldrafter/lib/node_modules/traveldrafter/web/";
basicAuthFile = config.sops.secrets.traveldrafter-htpasswd.path;
locations."/api" = {
proxyPass = "http://[::1]:3001";
};
};
};
systemd.services."traveldrafter" = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
RuntimeDirectory = "traveldrafter";
DynamicUser = true;
};
environment = {
HTTP_PORT = "3001";
};
script = lib.getExe pkgs.traveldrafter;
};
}

View File

@@ -5,12 +5,12 @@
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../../configuration/desktop
./initrd.nix ./initrd.nix
./programs.nix ./programs.nix
]; ];
profiles.clerie.desktop.enable = true;
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View File

@@ -8,6 +8,8 @@ let
lib = { lib = {
clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix; clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix;
mkNixpkgs = callLibs ./mkNixpkgs.nix;
nixosSystem = callLibs ./nixosSystem.nix;
}; };
in in

View File

@@ -1,22 +0,0 @@
{ ... }:
rec {
llIPv6 = localIP: peerIP: interface: {
ips = [
"${localIP}/128"
];
postSetup = ''
ip -6 route flush dev ${interface}
ip addr del dev ${interface} ${localIP}/128 && ip addr add dev ${interface} ${localIP}/128 peer ${peerIP}/128
'';
};
llIPv4 = localIP: peerIP: interface: {
ips = [
"${localIP}/32"
];
postSetup = ''
ip -4 route flush dev ${interface}
ip addr del dev ${interface} ${localIP}/32 && ip addr add dev ${interface} ${localIP}/32 peer ${peerIP}/32
'';
};
}

27
lib/mkNixpkgs.nix Normal file
View File

@@ -0,0 +1,27 @@
{
inputs,
self,
...
}:
/*
Loads a version of nixpkgs with nixfiles overlays loaded
*/
{
system,
nixpkgs ? inputs.nixpkgs,
overlays ? [],
...
}@args:
import nixpkgs {
inherit system;
overlays = [
self.overlays.clerie-inputs
self.overlays.clerie-pkgs
self.overlays.clerie-build-support
self.overlays.clerie-overrides
] ++ overlays;
}

42
lib/nixosSystem.nix Normal file
View File

@@ -0,0 +1,42 @@
{
inputs,
self,
...
}:
/*
nixfiles.lib.nixosSystem, like nixpkgs.lib.nixosSystem but
with nixfiles overlays and modules already populated
*/
{
system ? null,
nixpkgs ? inputs.nixpkgs,
pkgs ? null,
modules ? [],
...
}@args:
nixpkgs.lib.nixosSystem ({
system = system;
pkgs = if pkgs != null then pkgs else (self.lib.mkNixpkgs {
inherit system nixpkgs;
});
modules = [
self.nixosModules.nixfilesInputs
self.nixosModules.clerie
self.nixosModules.profiles
({ config, lib, ... }: {
/*
Make the contents of the flake availiable to modules.
Useful for having the monitoring server scraping the
target config from all other servers automatically.
*/
_module.args = {
inputs = inputs;
_nixfiles = self;
};
})
] ++ modules;
} // builtins.removeAttrs args [ "system" "nixpkgs" "pkgs" "modules" ] )

View File

@@ -3,18 +3,13 @@
with lib; with lib;
let let
cfg = config.clerie.system-auto-upgrade; cfg = config.services.bijwerken;
in in
{ {
options = { options = {
clerie.system-auto-upgrade = { services.bijwerken = {
enable = mkEnableOption "clerie system upgrade"; enable = mkEnableOption "Automatic system upgrades";
allowReboot = mkOption {
type = types.bool;
default = false;
description = "Monitor NixOS";
};
autoUpgrade = mkOption { autoUpgrade = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@@ -25,10 +20,15 @@ in
default = null; default = null;
description = "Systemd time string for starting the unit"; description = "Systemd time string for starting the unit";
}; };
nodeExporterTextfilePath = mkOption {
type = with types; nullOr str;
default = null;
description = "Path to node exporter textfile for putting metrics";
};
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.clerie-system-auto-upgrade = { systemd.services.bijwerken-system-upgrade = {
requires = [ "network-online.target" ]; requires = [ "network-online.target" ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
@@ -38,10 +38,10 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = pkgs.clerie-system-upgrade + "/bin/clerie-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/clerie-system-upgrade.prom"}"; ExecStart = (getExe pkgs.bijwerken-system-upgrade) + " --no-confirm${optionalString (cfg.nodeExporterTextfilePath != null) " --node-exporter-metrics-path ${cfg.nodeExporterTextfilePath}"}";
}; };
}; };
systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade { systemd.timers.bijwerken-system-upgrade = mkIf cfg.autoUpgrade {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt; OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
@@ -51,7 +51,7 @@ in
after = [ "network-online.target" ]; after = [ "network-online.target" ];
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
clerie-system-upgrade bijwerken-system-upgrade
]; ];
}; };
} }

View File

@@ -5,9 +5,9 @@
./policyrouting ./policyrouting
./akne ./akne
./backup ./backup
./bijwerken
./clerie-firewall ./clerie-firewall
./clerie-gc-dir ./clerie-gc-dir
./clerie-system-upgrade
./dhcpcd-prefixdelegation ./dhcpcd-prefixdelegation
./minecraft-server ./minecraft-server
./monitoring ./monitoring

View File

@@ -75,6 +75,8 @@ in
systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ]; systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
services.bijwerken.nodeExporterTextfilePath = "/var/lib/prometheus-node-exporter/textfiles/bijwerken-system-upgrade.prom";
services.prometheus.exporters.bird = mkIf cfg.bird { services.prometheus.exporters.bird = mkIf cfg.bird {
enable = true; enable = true;
}; };
@@ -102,6 +104,33 @@ in
listen = "[::]:9152"; listen = "[::]:9152";
}; };
services.prometheus.exporters.nginxlog = mkIf config.services.nginx.enable {
enable = true;
settings = {
namespaces = [
{
name = "nginxlog";
format = ''$host: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$server_name" rt="$request_time" uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"'';
source = {
files = [
"/var/log/nginx/access.log"
];
};
relabel_configs = [
{
target_label = "server_name";
from = "server_name";
}
];
}
];
};
};
systemd.services."prometheus-nginxlog-exporter".serviceConfig = {
SupplementaryGroups = "nginx";
};
networking.firewall.interfaces."wg-monitoring".allowedTCPPorts = [ networking.firewall.interfaces."wg-monitoring".allowedTCPPorts = [
9100 # node-exporter 9100 # node-exporter
9152 # nixos-exporter 9152 # nixos-exporter
@@ -109,6 +138,8 @@ in
9324 # bird-exporter 9324 # bird-exporter
] else []) ++ (if cfg.blackbox then [ ] else []) ++ (if cfg.blackbox then [
9115 # blackbox-exporter 9115 # blackbox-exporter
] else []) ++ (if config.services.prometheus.exporters.nginxlog.enable then [
config.services.prometheus.exporters.nginxlog.port
] else []); ] else []);
}; };
} }

View File

@@ -9,6 +9,8 @@ let
mkServerBlock = isUDP: port: forward: '' mkServerBlock = isUDP: port: forward: ''
server { server {
resolver ${cfg.resolver} ipv4=off valid=30s;
listen ${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"}; listen ${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"};
listen [::]:${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"}; listen [::]:${port}${optionalString isUDP " udp"}${optionalString (forward.certName != null) " ssl"};
@@ -18,7 +20,9 @@ let
${ optionalString (sslDhparam != null) "ssl_dhparam ${sslDhparam};" } ${ optionalString (sslDhparam != null) "ssl_dhparam ${sslDhparam};" }
'' } '' }
proxy_pass ${forward.host}:${toString forward.port}; set $upstream_server ${forward.host}:${toString forward.port};
proxy_pass $upstream_server;
} }
''; '';
@@ -50,6 +54,10 @@ in
options = { options = {
clerie.nginx-port-forward = { clerie.nginx-port-forward = {
enable = mkEnableOption "Nginx Port Forward"; enable = mkEnableOption "Nginx Port Forward";
resolver = mkOption {
type = types.str;
description = "IP address of the resolver to use for upstream hostnames";
};
tcpPorts = mkOption { tcpPorts = mkOption {
type = with types; attrsOf (submodule portOpts); type = with types; attrsOf (submodule portOpts);
default = {}; default = {};

55
monitoring/targets.json Normal file
View File

@@ -0,0 +1,55 @@
{
"clerie.de": {
"icmp": { "enable": true },
"http": { "enable": true }
},
"wiki.clerie.de": {
"http": { "enable": true }
},
"blog.nadja.top": {
"http": { "enable": true }
},
"fem.social": {
"http": { "enable": true }
},
"tagesschau.de": {
"icmp": { "enable": true }
},
"google.com": {
"icmp": { "enable": true }
},
"achtbaan.nikhef.nl": {
"icmp": { "enable": true }
},
"www.fem.tu-ilmenau.de": {
"icmp": { "enable": true }
},
"www.heise.de": {
"icmp": { "enable": true }
},
"dyon.net.entr0py.de": {
"_comment": "Backend server of matrix.entr0py.de",
"icmp": { "enable": true }
},
"matrix.bau-ha.us": {
"synapse": { "enable": true }
},
"matrix.entr0py.de": {
"synapse": { "enable": true }
},
"matrix.fachschaften.org": {
"synapse": { "enable": true }
},
"clerie.uber.space": {
"clerie-uberspace": { "enable": true }
},
"cleriewi.uber.space": {
"clerie-uberspace": { "enable": true }
},
"reichart.uber.space": {
"clerie-uberspace": { "enable": true }
}
}

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
TARGETS="$(nix --extra-experimental-features "nix-command flakes" eval --raw ".#nixosConfigurations" --apply "nixosConfigurations: builtins.concatStringsSep \"\\n\" (builtins.attrValues (builtins.mapAttrs (name: host: host.config.networking.fqdn) nixosConfigurations))")"
pssh -h <(echo "${TARGETS}") -i -- sudo systemctl start bijwerken-system-upgrade.service --no-block

View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "bijwerken-poke";
text = builtins.readFile ./bijwerken-poke.sh;
runtimeInputs = with pkgs; [
pssh
];
}

View File

@@ -2,16 +2,11 @@
set -euo pipefail set -euo pipefail
ALLOW_REBOOT=
NO_CONFIRM= NO_CONFIRM=
NODE_EXPORTER_METRICS_PATH= NODE_EXPORTER_METRICS_PATH=
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--allow-reboot)
ALLOW_REBOOT=1
shift
;;
--no-confirm) --no-confirm)
NO_CONFIRM=1 NO_CONFIRM=1
shift shift
@@ -45,7 +40,7 @@ if [[ -z $NO_CONFIRM ]]; then
fi fi
echo "Download ${STORE_PATH}" echo "Download ${STORE_PATH}"
nix copy --from "https://nix-cache.clerie.de" "${STORE_PATH}" nix copy --to daemon "${STORE_PATH}"
echo "Add to system profile" echo "Add to system profile"
nix-env -p "/nix/var/nix/profiles/system" --set "${STORE_PATH}" nix-env -p "/nix/var/nix/profiles/system" --set "${STORE_PATH}"
@@ -55,7 +50,7 @@ echo "Set as boot target"
if [[ -n "$NODE_EXPORTER_METRICS_PATH" ]]; then if [[ -n "$NODE_EXPORTER_METRICS_PATH" ]]; then
echo "Write monitoring check data" echo "Write monitoring check data"
echo "clerie_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH" echo "bijwerken_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH"
fi fi
BOOTED_SYSTEM_KERNEL="$(readlink /run/booted-system/{initrd,kernel,kernel-modules})" BOOTED_SYSTEM_KERNEL="$(readlink /run/booted-system/{initrd,kernel,kernel-modules})"
@@ -63,13 +58,8 @@ ACTIVATING_SYSTEM_KERNEL="$(readlink /nix/var/nix/profiles/system/{initrd,kernel
if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then
echo "Reboot is required" echo "Reboot is required"
if [[ -n "$ALLOW_REBOOT" ]]; then echo "Rebooting system now"
echo "Rebooting system now" shutdown -r +1 "System update requires reboot"
shutdown -r +1 "System update requires reboot"
else
echo "Automatic reboot not allowed (maybe use --allow-reboot next time)"
echo "The system upgrade is staged, please reboot manually soon"
fi
else else
echo "No reboot is required" echo "No reboot is required"
echo "Activating system now" echo "Activating system now"

View File

@@ -1,8 +1,8 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "clerie-system-upgrade"; name = "bijwerken-system-upgrade";
text = builtins.readFile ./clerie-system-upgrade.sh; text = builtins.readFile ./bijwerken-system-upgrade.sh;
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
curl curl
jq jq

View File

@@ -0,0 +1,7 @@
final: prev:
{
clerie-build-support = {
writePythonScript = final.callPackage ./writePythonScript.nix {};
};
}

View File

@@ -0,0 +1,56 @@
{
python3,
makeWrapper,
runCommand,
lib,
}:
{
name,
text,
runtimePackages ? ps: [],
pythonPackage ? python3,
runtimeInputs ? [],
meta ? {},
passthru ? {},
derivationArgs ? {},
}:
let
pythonWithPackages = pythonPackage.withPackages runtimePackages;
in runCommand name ({
passAsFile = [ "text" ] ++ (derivationArgs.passAsFile or []);
meta = {
mainProgram = name;
} // meta // (derivationArgs.meta or {});
passthru = passthru // (derivationArgs.passthru or {});
nativeBuildInputs = [ makeWrapper ] ++ (derivationArgs.nativeBuildInputs or []);
executable = true;
destination = "/bin/${name}";
allowSubstitutes = true;
preferLocalBuild = false;
text = ''
#!${lib.getExe pythonWithPackages}
${text}
'';
} // (
builtins.removeAttrs derivationArgs [ "passAsFile" "meta" "passthru" "nativeBuildInputs" ]
))
''
mkdir -p $out/bin
target=$out/bin/${lib.escapeShellArg name}
cp "$textPath" "$target"
chmod +x "$target"
wrapProgram "$target" --prefix PATH : "${lib.makeBinPath runtimeInputs}"
''

View File

@@ -1,13 +1,22 @@
{
writeTextFile,
}:
let let
stripR = str: if (builtins.substring ((builtins.stringLength str) - 1) (builtins.stringLength str) str) == "\n" then stripR (builtins.substring 0 ((builtins.stringLength str) - 1) str) else str; stripR = str: if (builtins.substring ((builtins.stringLength str) - 1) (builtins.stringLength str) str) == "\n" then stripR (builtins.substring 0 ((builtins.stringLength str) - 1) str) else str;
hostsWithSshPubkey = builtins.filter (hostname: (builtins.substring 0 1 hostname) != "_" && builtins.pathExists (../hosts + "/${hostname}/ssh.pub")) (builtins.attrNames (builtins.readDir ../hosts)); hostsWithSshPubkey = builtins.filter (hostname: (builtins.substring 0 1 hostname) != "_" && builtins.pathExists (../../hosts + "/${hostname}/ssh.pub")) (builtins.attrNames (builtins.readDir ../../hosts));
sshkeyList = map (hostname: { sshkeyList = map (hostname: {
name = hostname; name = hostname;
sshPubkey = stripR (builtins.readFile (../hosts + "/${hostname}/ssh.pub")); sshPubkey = stripR (builtins.readFile (../../hosts + "/${hostname}/ssh.pub"));
}) hostsWithSshPubkey; }) hostsWithSshPubkey;
knownHosts = builtins.concatStringsSep "" (builtins.map ({name, sshPubkey}: '' knownHosts = builtins.concatStringsSep "" (builtins.map ({name, sshPubkey}: ''
${name} ${sshPubkey} ${name} ${sshPubkey}
${name}.net.clerie.de ${sshPubkey} ${name}.net.clerie.de ${sshPubkey}
'') sshkeyList); '') sshkeyList);
in in writeTextFile {
knownHosts name = "clerie-ssh-known-hosts";
destination = "/known_hosts";
allowSubstitutes = true;
preferLocalBuild = false;
text = knownHosts;
}

View File

@@ -0,0 +1,109 @@
#!/usr/bin/env python
import argparse
from pathlib import Path
from progress.bar import Bar
import shutil
import subprocess
def files_and_dirs_for_directory(path):
filepaths = []
dirpaths = []
for dirpath, dirnames, filenames in path.walk():
dirpaths.append(dirpath)
for filename in filenames:
filepath = dirpath / filename
filepaths.append(filepath)
return set(filepaths), set(dirpaths)
def make_paths_relative(paths, relative_to_path):
return set(path.relative_to(relative_to_path) for path in paths)
def replace_suffix(path, suffix):
return path.with_name(path.stem + suffix)
def convert_filepath(path):
if path.suffix == ".flac":
return replace_suffix(path, ".mp3")
return path
def ffmpeg_flac_to_mp3(in_path, out_path):
print("")
subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "warning", "-stats", "-i", in_path, "-ab", "320k", "-map_metadata", "0", "-id3v2_version", "3", out_path], check=True)
print("")
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog="convert-flac-dir-to-mp3")
parser.add_argument("from_dir", type=Path)
parser.add_argument("to_dir", type=Path)
args = parser.parse_args()
from_path = args.from_dir.absolute()
to_path = args.to_dir.absolute()
if not from_path.exists():
raise Exception("from_path does not exist")
if not to_path.exists():
raise Exception("to_path does not exist")
if not from_path.is_dir():
raise Exception("from_path is not a directory")
if not to_path.is_dir():
raise Exception("to_path is not a directory")
print(f"Converting {from_path} to {to_path}")
from_filepaths, from_dirpaths = files_and_dirs_for_directory(from_path)
to_filepaths, to_dirpaths = files_and_dirs_for_directory(to_path)
relative_from_filepaths = make_paths_relative(from_filepaths, from_path)
relative_to_filepaths = make_paths_relative(to_filepaths, to_path)
converted_from_filepaths = set(convert_filepath(filepath) for filepath in relative_from_filepaths)
filepaths_missing_in_to_path = converted_from_filepaths - relative_to_filepaths
relative_from_dirpaths = make_paths_relative(from_dirpaths, from_path)
relative_to_dirpaths = make_paths_relative(to_dirpaths, to_path)
dirpaths_missing_in_to_path = relative_from_dirpaths - relative_to_dirpaths
print(f"Missing {len(filepaths_missing_in_to_path)} files and {len(dirpaths_missing_in_to_path)} directories")
if len(dirpaths_missing_in_to_path) > 0:
for dirpath in Bar("Creating directories").iter(dirpaths_missing_in_to_path):
(to_path / dirpath).mkdir(parents=True, exist_ok=True)
if len(filepaths_missing_in_to_path) > 0:
for filepath in Bar("Creating files").iter(filepaths_missing_in_to_path):
if filepath in relative_from_filepaths:
# Just copy the file
shutil.copy(from_path / filepath, to_path / filepath)
elif filepath.suffix == ".mp3" and replace_suffix(filepath, ".flac") in relative_from_filepaths:
# Convert from flac
print("")
print(f"Converting {to_path / filepath}")
# Tempfile for ffmpeg
tmpfilepath = filepath.with_name(".~" + filepath.name)
(to_path / tmpfilepath).unlink(missing_ok=True)
print(f"Using tempfile for ffmpeg {to_path / tmpfilepath}")
# Convert
ffmpeg_flac_to_mp3(from_path / replace_suffix(filepath, ".flac"), to_path / tmpfilepath)
# Rename tempfile
(to_path / tmpfilepath).rename(to_path / filepath)
else:
raise Exception("Unable to figure out how to get {to_path / filepath} from {from_path}")

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
pkgs.clerie-build-support.writePythonScript {
name = "convert-flac-dir-to-mp3";
runtimePackages = ps: with ps; [ progress ];
runtimeInputs = [ pkgs.ffmpeg-headless ];
text = builtins.readFile ./convert-flac-dir-to-mp3.py;
}

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
curl -w "Request to %{url}
time_namelookup: %{time_namelookup}s
time_connect: %{time_connect}s
time_appconnect: %{time_appconnect}s
time_pretransfer: %{time_pretransfer}s
time_starttransfer: %{time_starttransfer}s
time_posttransfer: %{time_posttransfer}s
time_queue: %{time_queue}s
time_redirect: %{time_redirect}s
time_starttransfer: %{time_starttransfer}s
time_total: %{time_total}s
" -o /dev/null -s "$@"

View File

@@ -0,0 +1,12 @@
{
curl,
writeShellApplication,
}:
writeShellApplication {
name = "curl-timings";
text = builtins.readFile ./curl-timings.sh;
runtimeInputs = [
curl
];
}

View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "ds-lite-dhcpcd-hook";
text = builtins.readFile ./ds-lite-dhcpcd-hook.sh;
runtimeInputs = with pkgs; [
iproute2
jq
dig
gawk
];
}

View File

@@ -0,0 +1,102 @@
#!/usr/bin/env bash
set -euo pipefail
# Setting up required environment variables
# shellcheck disable=SC2154
WAN_INTERFACE_NAME="${DS_LITE_WAN_INTERFACE_NAME}"
# shellcheck disable=SC2154
TUNNEL_INTERFACE_NAME="${DS_LITE_TUNNEL_INTERFACE_NAME}"
log_dhcp () {
echo "<ds-lite-dhcpcd-hook> ${WAN_INTERFACE_NAME}: $1"
}
log_tunnel () {
echo "<ds-lite-dhcpcd-hook> ${WAN_INTERFACE_NAME} (${TUNNEL_INTERFACE_NAME}): $1"
}
# Check if the event calling this hook is for the wan interface
# exit immediately if not
# shellcheck disable=SC2154
if [[ "$interface" != "$WAN_INTERFACE_NAME" ]]; then
exit
fi
# Make sure the event calling this hook carries the environment variable
# in question. The environment variable is not provided with every call
# and we just want to exit if it is not provided
# shellcheck disable=SC2154
if [[ ! -v new_dhcp6_aftr_name ]]; then
# Variable is not set
exit
fi
# shellcheck disable=SC2154
if [[ -z "${new_dhcp6_aftr_name}" ]]; then
# Variable is empty, can't do anything
exit
fi
# shellcheck disable=SC2154
AFTR_NAME="$new_dhcp6_aftr_name"
log_dhcp "Received new AFTR_NAME ${AFTR_NAME}"
# Make sure we have a nameserver to resolve aftr name against
# shellcheck disable=SC2154
if [[ ! -v new_dhcp6_name_servers ]]; then
# Variable is not set
exit
fi
# shellcheck disable=SC2154
if [[ -z "${new_dhcp6_name_servers}" ]]; then
# Variable is empty, can't do anything
exit
fi
# shellcheck disable=SC2154
NAME_SERVERS="$new_dhcp6_name_servers"
log_dhcp "Received new NAME_SERVERS ${NAME_SERVERS}"
# Select first nameserver
NAME_SERVER="$(echo "${NAME_SERVERS}" | awk '{print $1;}')"
log_dhcp "Selected NAME_SERVER ${NAME_SERVER}"
# Figure out a usable IPv6 address on the wan interface, to origin our DNS requests and tunnel
WAN_INTERFACE_ADDRESS="$(ip --json address show "${WAN_INTERFACE_NAME}" | jq -r '.[0].addr_info[] | select(.family == "inet6" and .scope == "global" and .mngtmpaddr == true) | .local')"
log_dhcp "Using WAN_INTERFACE_ADDRESS ${WAN_INTERFACE_ADDRESS}"
AFTR_ADDRESS="$(dig "@${NAME_SERVER}" -b "${WAN_INTERFACE_ADDRESS}" AAAA "${AFTR_NAME}" +short | head -1)"
log_dhcp "Resolved AFTR_NAME ${AFTR_NAME} to ${AFTR_ADDRESS}"
# Check if there is already a tunnel interface
if TUNNEL_INTERFACE_CONFIG="$(ip --json link show "${TUNNEL_INTERFACE_NAME}")"; then
TUNNEL_INTERFACE_OPERSTATE="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].operstate')"
TUNNEL_INTERFACE_ORIGIN_ADDRESS="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].address')"
TUNNEL_INTERFACE_REMOTE_ADDRESS="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].broadcast')"
# Reconfigure tunnel interface, if not already in state we want
if [[ "${TUNNEL_INTERFACE_ORIGIN_ADDRESS}" != "${WAN_INTERFACE_ADDRESS}" || "${TUNNEL_INTERFACE_REMOTE_ADDRESS}" != "${AFTR_ADDRESS}" || "${TUNNEL_INTERFACE_OPERSTATE}" != "UNKNOWN" ]]; then
log_tunnel "Bad configuration, fixing tunnel parameter"
ip tunnel change "${TUNNEL_INTERFACE_NAME}" mode ipip6 local "${WAN_INTERFACE_ADDRESS}" remote "${AFTR_ADDRESS}"
ip link set "$TUNNEL_INTERFACE_NAME" up
else
log_tunnel "Tunnel already configured"
fi
else
log_tunnel "Setting up DS-Lite tunnel"
ip tunnel add "${TUNNEL_INTERFACE_NAME}" mode ipip6 local "${WAN_INTERFACE_ADDRESS}" remote "${AFTR_ADDRESS}"
ip link set "$TUNNEL_INTERFACE_NAME" up
fi
log_tunnel "Setting default route"
ip route replace default dev "${TUNNEL_INTERFACE_NAME}"
log_tunnel "Tunnel setup finished"

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
pkgs.clerie-build-support.writePythonScript {
name = "generate-blocked-prefixes";
runtimePackages = ps: with ps; [ requests ];
text = builtins.readFile ./generate-blocked-prefixes.py;
}

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import ipaddress
import requests
blocked_asns = [
"45102", # Alibaba (US) Technology Co., Ltd.
]
r = requests.get('https://bgp.tools/table.txt', stream=True, headers={
"User-Agent": "https://git.clerie.de/clerie/nixfiles",
})
selected_ipv6_prefixes = []
selected_ipv4_prefixes = []
for line in r.iter_lines(decode_unicode=True):
prefix_string, asn_string = line.split()
if asn_string in blocked_asns:
prefix = ipaddress.ip_network(prefix_string)
if prefix.version == 6:
selected_ipv6_prefixes.append(prefix)
else:
selected_ipv4_prefixes.append(prefix)
selected_ipv6_prefixes = list(ipaddress.collapse_addresses(selected_ipv6_prefixes))
selected_ipv4_prefixes = list(ipaddress.collapse_addresses(selected_ipv4_prefixes))
selected_ipv6_prefixes.sort()
selected_ipv4_prefixes.sort()
with open("hosts/web-2/blocked-prefixes.txt", "w") as blocked_ips_file:
for ipv6_prefix in selected_ipv6_prefixes:
blocked_ips_file.write(f"ip6tables -I nixos-fw -s {ipv6_prefix} -j nixos-fw-refuse\n")
for ipv4_prefix in selected_ipv4_prefixes:
blocked_ips_file.write(f"iptables -I nixos-fw -s {ipv4_prefix} -j nixos-fw-refuse\n")

View File

@@ -1,13 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
pkgs.writeTextFile { pkgs.clerie-build-support.writePythonScript {
name = "git-show-link"; name = "git-show-link";
executable = true; text = builtins.readFile ./git-show-link.py;
destination = "/bin/git-show-link";
allowSubstitutes = true;
preferLocalBuild = false;
text = ''
#!${pkgs.python3.withPackages (ps: with ps; [])}/bin/python3
${builtins.readFile ./git-show-link.py}
'';
} }

View File

@@ -4,21 +4,28 @@ import argparse
from dataclasses import dataclass from dataclasses import dataclass
import re import re
import subprocess import subprocess
from pathlib import Path
REMOTE_TYPES = [ REMOTE_TYPES = {
{ "github": {
# github
"match": re.compile(r'git@github.com:(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'), "match": re.compile(r'git@github.com:(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'),
"format-branch": lambda g: f"https://github.com/{g.username}/{g.project}/tree/{g.branch}/", "format-branch": lambda g: f"https://github.com/{g.username}/{g.project}/tree/{g.branch}/",
"format-branch-file": lambda g: f"https://github.com/{g.username}/{g.project}/blob/{g.branch}/{g.file}",
"format-branch-dir": lambda g: f"https://github.com/{g.username}/{g.project}/tree/{g.branch}/{g.dir}",
"format-commit": lambda g: f"https://github.com/{g.username}/{g.project}/commit/{g.commit}/", "format-commit": lambda g: f"https://github.com/{g.username}/{g.project}/commit/{g.commit}/",
"format-commit-file": lambda g: f"https://github.com/{g.username}/{g.project}/blob/{g.commit}/{g.file}",
"format-commit-dir": lambda g: f"https://github.com/{g.username}/{g.project}/tree/{g.commit}/{g.dir}",
}, },
{ "gitea": {
# gitea
"match": re.compile(r'(?P<gituser>[\w\.-]+)@(?P<host>[\w\.-]+):(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'), "match": re.compile(r'(?P<gituser>[\w\.-]+)@(?P<host>[\w\.-]+):(?P<username>[\w\.-]+)/(?P<project>[\w\.-]+).git'),
"format-branch": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/branch/{g.branch}/", "format-branch": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/branch/{g.branch}/",
"format-branch-file": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/branch/{g.branch}/{g.file}",
"format-branch-dir": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/branch/{g.branch}/{g.dir}",
"format-commit": lambda g: f"https://{g.host}/{g.username}/{g.project}/commit/{g.commit}/", "format-commit": lambda g: f"https://{g.host}/{g.username}/{g.project}/commit/{g.commit}/",
"format-commit-file": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/commit/{g.commit}/{g.file}",
"format-commit-dir": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/commit/{g.commit}/{g.dir}",
}, },
] }
@dataclass @dataclass
class FormatArgs: class FormatArgs:
@@ -28,10 +35,25 @@ class FormatArgs:
project: str = None project: str = None
commit: str = None commit: str = None
branch: str = None branch: str = None
file: str = None
dir: str = None
def is_git_repo():
s = subprocess.run(["git", "rev-parse"], capture_output=True, text=True)
return s.returncode == 0
def get_git_dir():
s = subprocess.run(["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True)
return Path(s.stdout.strip())
def get_remote_branch(): def get_remote_branch():
s = subprocess.run(["git", "status", "--porcelain", "-uno", "-b", "--no-ahead-behind"], capture_output=True, text=True) s = subprocess.run(["git", "status", "--porcelain", "-uno", "-b", "--no-ahead-behind"], capture_output=True, text=True)
if s.stdout.startswith("## HEAD (no branch)"):
print("Detached head, can't link")
exit(1)
git_status_branch_info = s.stdout.splitlines()[0][3:].split()[0] git_status_branch_info = s.stdout.splitlines()[0][3:].split()[0]
branches = git_status_branch_info.split("...") branches = git_status_branch_info.split("...")
@@ -41,7 +63,7 @@ def get_remote_branch():
local_branch, remote_branch = branches local_branch, remote_branch = branches
remote, branch = remote_branch.split("/") remote, branch = remote_branch.split("/", maxsplit=1)
return { return {
"remote": remote, "remote": remote,
@@ -67,31 +89,89 @@ def main():
prog='git-show-link', prog='git-show-link',
) )
parser.add_argument("path", nargs="?", default=None, help="Path to link to specific file or directory")
parser.add_argument("--branch", dest="display_branch", action='store_true', help="Display link to branch, instead to commit") parser.add_argument("--branch", dest="display_branch", action='store_true', help="Display link to branch, instead to commit")
parser.add_argument("--remote-type", dest="remote_type", choices=REMOTE_TYPES.keys(), help="Specify remote type")
args = parser.parse_args() args = parser.parse_args()
if not is_git_repo():
print("Not a git repo")
exit(1)
git_dir_path = get_git_dir()
r = get_remote_branch() r = get_remote_branch()
remote_url = get_remote_url(r["remote"]) remote_url = get_remote_url(r["remote"])
for remote_type in REMOTE_TYPES: selected_remote_types = REMOTE_TYPES
if args.remote_type is not None:
selected_remote_types = {
args.remote_type: REMOTE_TYPES[args.remote_type],
}
remote_type_found = False
for remote_type_name, remote_type in selected_remote_types.items():
m = remote_type["match"].match(remote_url) m = remote_type["match"].match(remote_url)
if m is None: if m is None:
continue continue
remote_type_found = True
g = FormatArgs(**m.groupdict()) g = FormatArgs(**m.groupdict())
if args.display_branch: if args.path is not None:
g.branch = r["branch"] path = Path(args.path).absolute()
print(remote_type["format-branch"](g)) path = path.relative_to(git_dir_path)
if path.is_dir():
path = str(path)
if path == ".":
path = ""
else:
path += "/"
g.dir = path
else:
g.file = str(path)
if g.file is not None:
if args.display_branch:
g.branch = r["branch"]
print(remote_type["format-branch-file"](g))
else:
commit = get_last_commit()
g.commit = commit
print(remote_type["format-commit-file"](g))
elif g.dir is not None:
if args.display_branch:
g.branch = r["branch"]
print(remote_type["format-branch-dir"](g))
else:
commit = get_last_commit()
g.commit = commit
print(remote_type["format-commit-dir"](g))
else: else:
commit = get_last_commit() if args.display_branch:
g.commit = commit g.branch = r["branch"]
print(remote_type["format-commit"](g)) print(remote_type["format-branch"](g))
else:
commit = get_last_commit()
g.commit = commit
print(remote_type["format-commit"](g))
break break
if not remote_type_found:
print("No remote type matched")
exit(1)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -0,0 +1,19 @@
{
e2fsprogs,
gptfdisk,
jq,
parted,
writeShellApplication,
}:
writeShellApplication {
name = "grow-last-partition-and-filesystem";
text = builtins.readFile ./grow-last-partition-and-filesystem.sh;
runtimeInputs = [
e2fsprogs
gptfdisk
jq
parted
];
}

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "Pass device to grow as first argument:"
echo "grow-last-partition-and-filesystem DEVICE"
exit 1
fi
DEVICE="$1"
echo "Move GTP backup header to end of disk"
sgdisk "${DEVICE}" --move-second-header
PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)"
PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')"
PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')"
echo "Growing partition ${DEVICE}${PARTNUMBER} (${PARTNAME})"
echo
parted "${DEVICE}" resizepart "${PARTNUMBER}" 100%
echo
echo "Resizing filesystem"
echo
resize2fs "${DEVICE}${PARTNUMBER}"
echo "Done."

View File

@@ -0,0 +1,14 @@
{
python3,
writeShellApplication,
}:
writeShellApplication {
name = "http.server";
text = ''
python3 -m http.server "$@"
'';
runtimeInputs = [
python3
];
}

View File

@@ -1 +1,38 @@
final: prev: builtins.mapAttrs (name: value: value final prev) (import ./pkgs.nix) final: prev: {
bijwerken-poke = final.callPackage ./bijwerken-poke {};
bijwerken-system-upgrade = final.callPackage ./bijwerken-system-upgrade {};
clerie-backup = final.callPackage ./clerie-backup {};
clerie-cleanup-branches = final.callPackage ./clerie-update-nixfiles/clerie-cleanup-branches.nix {};
clerie-keys = final.callPackage ./clerie-keys {};
clerie-ssh-known-hosts = final.callPackage ./clerie-ssh-known-hosts {};
clerie-system-remote-install = final.callPackage ./clerie-system-remote-install {};
clerie-merge-nixfiles-update = final.callPackage ./clerie-update-nixfiles/clerie-merge-nixfiles-update.nix {};
clerie-sops = final.callPackage ./clerie-sops/clerie-sops.nix {};
clerie-sops-config = final.callPackage ./clerie-sops/clerie-sops-config.nix {};
clerie-sops-edit = final.callPackage ./clerie-sops/clerie-sops-edit.nix {};
clerie-update-nixfiles = final.callPackage ./clerie-update-nixfiles/clerie-update-nixfiles.nix {};
chromium-incognito = final.callPackage ./chromium-incognito {};
convert-flac-dir-to-mp3 = final.callPackage ./convert-flac-dir-to-mp3 {};
curl-timings = final.callPackage ./curl-timings {};
ds-lite-dhcpcd-hook = final.callPackage ./ds-lite-dhcpcd-hook {};
factorio-launcher = final.callPackage ./factorio-launcher {};
feeds-dir = final.callPackage ./feeds-dir {};
generate-blocked-prefixes = final.callPackage ./generate-blocked-prefixes {};
git-checkout-github-pr = final.callPackage ./git-checkout-github-pr {};
git-diff-word = final.callPackage ./git-diff-word {};
git-pp = final.callPackage ./git-pp {};
git-show-link = final.callPackage ./git-show-link {};
grow-last-partition-and-filesystem = final.callPackage ./grow-last-partition-and-filesystem {};
"http.server" = final.callPackage ./http.server {};
nix-remove-result-links = final.callPackage ./nix-remove-result-links {};
nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {};
nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {};
nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};
nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {};
pipewire-all-bluetooth = final.callPackage ./pipewire-all-bluetooth {};
print-afra = final.callPackage ./print-afra {};
run-with-docker-group = final.callPackage ./run-with-docker-group {};
ssh-gpg = final.callPackage ./ssh-gpg {};
update-from-hydra = final.callPackage ./update-from-hydra {};
uptimestatus = final.python3.pkgs.callPackage ./uptimestatus {};
}

View File

@@ -1,10 +1,8 @@
final: prev: final: prev:
prev.dino.overrideAttrs (finalAttrs: prevAttrs: { prev.dino.overrideAttrs (finalAttrs: prevAttrs: {
patches = [ mesonFlags = prevAttrs.mesonFlags ++ [
(final.fetchpatch { (final.lib.mesonEnable "plugin-openpgp" false)
# in new chats, enable omemo by default (final.lib.mesonEnable "plugin-notification-sound" false)
url = "https://cyberchaos.dev/-/snippets/25/raw/main/omemo-default.patch";
hash = "sha256-WXu9R+SKexgSQ93sQfFXG2CIboW3pYe5d1nsiP07wtE=";
})
]; ];
}) })

Some files were not shown because too many files have changed in this diff Show More