Commit graph

172 commits

Author SHA1 Message Date
34a45af357 flake: split mediaserver onto nixos-25.11, keep desktops on unstable
The mediaserver kept hard-freezing on local builds (gnupg, openldap,
deno/rusty-v8) whenever a fresh unstable revision outran Hydra's
binary cache. It doesn't need bleeding-edge packages — every service
it runs is mature enough that 6-month-old versions are fine — so move
it onto the stable channel where the cache is essentially always
warm. Gaming and Macbook stay on unstable for fresh GPU/kernel work.

Implementation: add nixpkgs-stable + home-manager-stable inputs,
parameterise mkHost to accept a (nixpkgs, home-manager) pair.

Drive-by:
- Switch homepage.nix from environmentFiles (plural, unstable-only)
  to environmentFile (singular, present on both channels).
- Gate the openldap-skip-tests overlay to non-mediaserver hosts so
  it doesn't force a local rebuild on stable, where openldap is
  always cached.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 13:26:07 +01:00
057d24517f common: cap parallel builds + zramSwap to survive local rebuild storms
The mediaserver (56 cores, 31 GiB RAM, no swap) was hard-freezing on
local builds of gnupg/openldap because Nix defaulted max-jobs=auto and
launched ~56 parallel gcc compilations, blowing past available memory
and OOM-stalling AdGuard.

Cap parallelism (max-jobs=4, cores=8 per build) and add zramSwap as a
compressed in-memory safety net so a build storm can't take services
with it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 11:57:40 +01:00
70ee0fc811 common: cap nix-daemon CPUWeight at 50 to keep services responsive
Heavy local builds (gnupg/openldap checkPhase under a freshly-bumped
nixpkgs lock) were saturating CPU and starving AdGuard on the
mediaserver, making DNS effectively unresponsive until the build
finished or got cancelled.

Halving the daemon's CPU share leaves headroom for latency-sensitive
services without meaningfully slowing builds on an otherwise idle box.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 11:17:51 +01:00
e99bc7cc9b recyclarr: add weekly TRaSH-Guide profile sync for Sonarr & Radarr
Score-based release filtering replaces the brittle "minimum size" approach
— good HEVC encodes from reputable groups now win regardless of file
size, while obfuscated/no-group/lazy-x265 garbage gets banned.

Profiles installed:
  Sonarr: WEB-1080p (default), UHD Bluray + WEB (per-show opt-in)
  Radarr: HD Bluray + WEB (default), UHD Bluray + WEB (per-movie opt-in)

AV1 is banned across all four profiles since the GPU lacks hardware
decode. API keys are extracted at runtime from each *arr's config.xml,
matching the arr-interconnect pattern.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 10:31:09 +01:00
336d9df6a6 common: skip openldap test phase as temp workaround
test017-syncreplication-refresh is timing-flaky and fails reliably on
local builds when Hydra's binary cache hasn't yet served the upstream
artifact. Overlay sets doCheck=false so the build can proceed. Remove
once the substituter catches up to the pinned nixpkgs revision.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 13:01:07 +01:00
a124f314d9 common: bake --impure into update alias
CrowdSec reads the ntfy topic URL from /var/secrets/ntfy-url at eval
time via builtins.readFile. Pure flake mode forbids reading paths
outside the source tree, so without --impure the read silently falls
through to the placeholder URL on every rebuild. Adding --impure to
both build and switch keeps the secret-file pattern working.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 19:35:32 +01:00
525147aa61 fail2ban: remove — superseded by CrowdSec
CrowdSec covers the same surface (sshd, authelia, nginx, *arr apps,
qBit) with the addition of community-sourced threat intel and ntfy
push alerts. Keeping both was redundant. State at /var/lib/fail2ban
will sit unused until cleaned up by hand.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 19:26:24 +01:00
7ec6146917 crowdsec: add community IDS/IPS with ntfy push alerts
Enables the CrowdSec agent with sshd/nginx/http-cve hub collections,
acquires logs from nginx, sshd, and Authelia journald, and wires the
firewall bouncer to enforce bans via nftables. Alerts are POSTed to a
self-chosen ntfy.sh topic (URL read from /var/secrets/ntfy-url, falls
back to a placeholder so the repo stays eval-clean without the secret).

Module is self-contained — remove the file + import to uninstall; state
lives under /var/lib/crowdsec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 22:30:16 +01:00
77eafded92 Turn mediaserver into a home router
Adds services/router.nix with systemd-networkd (eno1=WAN via DHCP,
eth0=LAN 10.0.0.1/24), nftables (NAT + firewall, default drop on WAN
in), dnsmasq (DHCP only — AdGuard Home keeps :53 for DNS), and sysctl
IP forwarding. NetworkManager is forced off on this host.

Port forwards live in ports.toml at the repo root and are imported via
builtins.fromTOML. Supports single ports, ranges ("26901-26902"), and
"both" protocol. Initial forwards: 22, 80, 443, 26900, 26901-26902.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 09:48:38 +01:00
a825e36e2e Make AdGuard settings authoritative; add busybox; drop fallback DNS
- services/adguard.nix: mutableSettings = false so Nix config overrides
  UI-made changes on rebuild (settings are the source of truth)
- common.nix: add busybox for its collection of handy utilities
- common.nix: remove networking.nameservers — DNS now comes purely from
  per-host NetworkManager config (AdGuard as the only resolver, no leaks)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 19:57:55 +01:00
919c991e3d Add AdGuard Home for network-wide DNS ad blocking
New services/adguard.nix runs AdGuard Home on the mediaserver with DoH
upstreams (Cloudflare + Quad9) and three default blocklists. DNS listens
on :53; web UI on 127.0.0.1:3000, reverse-proxied at adguard.nordhammer.it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 13:40:30 +01:00
c05f986e1c Add 7 Days to Die dedicated server container; drop V-Rising
Enables the previously-disabled game-servers module with a new 7DTD
container (vinanrra/7dtd-server) on ports 26900 TCP + 26900-26902 UDP.
A oneshot systemd service waits for LGSM's first install to drop
sdtdserver.xml, then patches in the server name, password, and
random-gen world before restarting the container. V-Rising is removed
— the module hadn't been imported, so this just drops dead code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 22:28:49 +01:00
f57c6e99ec Add Last Update widget to Homepage via record-update script
record-update parses nvd diff after switch and writes latest.json;
Homepage polls a local-only nginx listener and renders date/changes/
closure/kernel via a customapi widget.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-16 20:58:19 +01:00
df227ad173 Revert "Add Tdarr transcoding manager for bulk H.264→HEVC conversion"
This reverts commit 91c437de6d.
2026-04-15 10:23:28 +01:00
91c437de6d Add Tdarr transcoding manager for bulk H.264→HEVC conversion
Runs Tdarr server with internal node on the mediaserver for managing
library-wide re-encoding to save disk space. Web UI at tdarr.nordhammer.it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 10:17:09 +01:00
e1f073969b Fix reboot alias auth prompt and minor formatting
Add sudo to reboot alias so it doesn't prompt for password.
Add blank line before networking.hostName in hardware config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 09:23:12 +01:00
a109d5a5c7 Disable game servers while not in use
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:10:20 +01:00
8aa7beccd6 Re-enable all services after secret migration to new server
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 21:59:18 +01:00
5b12b59654 Temporarily disable game servers for server migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 16:05:16 +01:00
3c8d5678b0 Temporarily disable services requiring secrets for server migration
Commented out nginx, go2rtc, cloudflare-ddns, fail2ban, and authelia
until secrets are migrated to the new server hardware.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 16:03:50 +01:00
25189a0d99 Skip matugen in update alias when not installed
Guard matugen call with command -v check so the update alias
works on hosts without GNOME/matugen (e.g. mediaserver).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 09:44:00 +01:00
effa5e5cbb Add wallpaper-based color theming with matugen
- Matugen templates for Ghostty theme and GTK4 colors
- Ghostty uses generated wallpaper theme instead of Catppuccin
- GTK4 CSS imports generated color overrides
- Update alias runs matugen after switch to regenerate colors
- Add wallpaper fish function to change wallpaper + regen colors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 19:56:38 +01:00
7a6ee02360 Forward arguments through update alias to nixos-rebuild
Allows passing flags like --refresh to both build and switch steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 19:43:32 +01:00
e19c03bda6 Fix update alias for fish compatibility
Wrap in bash -c since fish doesn't support bash variable
assignment syntax in aliases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:48:27 +01:00
e156d79862 Show nvd package diff after switch completes
Saves the old system path before switching so nvd can compare
old vs new after everything else finishes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:47:06 +01:00
7088f1d68e Add nvd package diff to update alias
The update alias now builds first, shows a readable diff of
added/removed/upgraded packages via nvd, then switches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:44:28 +01:00
e3a208deae Remove Helium browser
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 21:18:25 +01:00
c6986a8a3c Add Helium browser with Proton Pass and disabled password manager
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 21:13:45 +01:00
Claude
a35281419f
Move V-Rising Docker server into game-servers.nix
Consolidates V-Rising into the existing game-servers module instead of
a separate file. Also uncomments the game-servers import in common.nix
and adds UDP 9876/9877 to the shared firewall rules.

https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV
2026-04-11 14:46:04 +00:00
Claude
f556d887c3
Add V-Rising dedicated server via Docker on FredOS-Mediaserver
Uses NixOS virtualisation.oci-containers (Docker backend) with the
trueosiris/vrising image. Persists server files and save data under
/var/lib/v-rising/. Opens UDP 9876/9877 in the firewall.

https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV
2026-04-11 14:45:02 +00:00
9c08a9e0ef Rename fastfetch.nix -> settings/shell.nix, remove flatpaks
- Move shell/prompt/font config from apps/fastfetch.nix to settings/shell.nix
- Remove flatpaks.nix and nix-flatpak flake input (no flatpak packages in use)
- Update readme structure and flake inputs table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 14:03:34 +01:00
efd3351ee7 Powerline-style prompt with background colors, remove fastfetch from startup
- Prompt segments now have background colors (green/yellow/blue pills)
- NixOS icon  visible in green pill segment
- Remove fastfetch from terminal startup and clear alias
- fastfetch still available via manual `fastfetch` command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 13:34:36 +01:00
09d00909cb Switch to fish shell, ghostty terminal, and simplified prompt
- Replace bash with fish as default shell (all hosts)
- Replace kgx with ghostty (desktop hosts), update Super+T keybinding
- Custom two-line fish prompt: NixOS icon, username, path, hostname, ❯
- Nix-shell awareness, red ❯ on error
- Simplify fastfetch: user@host, OS, kernel, shell, terminal, uptime, memory
- Ghostty config: FiraCode Nerd Font, catppuccin-mocha, no titlebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 13:22:21 +01:00
eadbc92126 Replace Docker containers with native NixOS modules for nginx, Authelia, and go2rtc
- Native nginx with ACME wildcard cert (*.nordhammer.it) via Cloudflare DNS-01
- Native Authelia SSO with forward auth protecting homepage + camera
- Native go2rtc camera streaming (no more Docker)
- Auto-migration script for Authelia secrets and user database from Docker
- Homepage hrefs updated to use HTTPS domain names
- Fail2ban updated for native nginx log paths + new Authelia jail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:47:56 +01:00
f59fce5087 Add auto-interconnect service for *arr stack
Systemd oneshot that runs after all services start and configures:
- Prowlarr → Sonarr (TV indexers, full sync)
- Prowlarr → Radarr (movie indexers, full sync)
- Sonarr → qBittorrent (download client, category: tv-sonarr)
- Radarr → qBittorrent (download client, category: radarr)
- Bazarr → Sonarr (subtitle management for TV)
- Bazarr → Radarr (subtitle management for movies)

Fully idempotent — checks for existing connections before creating.
API keys extracted from each app's config files at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 13:45:53 +01:00
29dae0c5ea Add Homepage dashboard for FredOS-Mediaserver
Covers all running services: Jellyfin, Sonarr, Radarr, Bazarr, Prowlarr,
qBittorrent, Nginx Proxy Manager, Authelia, go2rtc. Live widgets for
*arr apps, Jellyfin now-playing, and qBittorrent speed use API keys
loaded from /etc/homepage-secrets (outside the Nix store).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 12:55:42 +01:00
39450ca786 Remove Suricata/ELK; add SSH key auth and disable password login
Adds authorised keys for FredOS-Gaming and phone. Disables SSH password
authentication on FredOS-Mediaserver — key auth only going forward.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:48:08 +01:00
699bbd9f9a Add ELK stack for Suricata log visualisation
Elasticsearch + Kibana + Filebeat in Docker, bridged via an elk network.
Filebeat uses the Suricata module to parse eve.json and auto-installs
Kibana dashboards on first run. ES heap capped at 1g; Kibana Node heap
at 512m — total stack ~2-2.5 GB RAM.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:25:29 +01:00
b91b0ef234 Add Suricata IDS to FredOS-Mediaserver
Passive network monitoring via af-packet on eno1. Rulesets auto-updated
from ET/Open, abuse.ch, and other community sources via suricata-update.
Runs alongside fail2ban; IPS/blocking mode can be enabled later.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 20:36:45 +01:00
Claude
6b432f3bc2
Remove CrowdSec — replaced by fail2ban
https://claude.ai/code/session_01PwAXuaoJx7qD5FhVLsn7Sn
2026-04-06 08:28:08 +00:00
Claude
16363dc887
fail2ban: add jails for SSH, nginx proxy manager, and Jellyfin
Replaces bare enable flag with a dedicated service module covering:
- SSH brute force via journald
- Nginx Proxy Manager auth failures via Docker log files
- Jellyfin auth failures via journald
Includes incremental ban times (up to 1 week) and LAN ignore rules.

https://claude.ai/code/session_01PwAXuaoJx7qD5FhVLsn7Sn
2026-04-06 08:21:23 +00:00
509c4cc47d Add CrowdSec IPS with firewall bouncer on FredOS-Mediaserver
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 22:59:37 +01:00
4b41511e39
Update common.nix 2026-04-05 11:21:25 +01:00
93ea194da4 Reorganise hardware vs host config, tidy settings and services 2026-04-01 21:16:59 +01:00
59e4d997cd
2026-03-28 19:40:00 +00:00
f6fb6ceba1
2026-03-28 15:57:10 +00:00
880f56265f
2026-03-28 15:34:14 +00:00
e0305d672c
2026-03-28 15:30:07 +00:00
5c96b6fa02
2026-03-28 15:28:37 +00:00
d0ed3fe5c8
2026-03-28 14:54:56 +00:00