nix-config/nixos/viridian/services/lighttpd/default.nix
jasmine b0bfb37d3c
refactor(viridian): migrate service data to dedicated BTRFS subvolumes
Migrate from path-based persistence (/persist/var/lib/*) to dedicated
BTRFS subvolumes for better data isolation and snapshot capabilities.

- Move valuable user-facing services to /srv/* with srv-* subvolumes:
  - forgejo: git repositories and database
  - opengist: paste data
  - minecraft: game world data
  - lighttpd: static web content
  - containers: OCI container volumes

- Update home directory to use hm-sajenim subvolume on viridian disk
- Remove jupyterhub service (no longer in use)
- Update borgbackup paths to match new service locations
- Follow upstream service defaults where possible for maintainability

Services kept on /persist (disposable state):
- traefik, crowdsec, murmur
2025-10-06 13:07:46 +08:00

34 lines
750 B
Nix

{config, ...}: let
hostname = config.networking.hostName;
in {
services.lighttpd = {
enable = true;
port = 5624;
document-root = "/srv/lighttpd/sajenim.dev";
};
services.traefik.dynamicConfigOptions.http.routers = {
lighttpd = {
rule = "Host(`sajenim.dev`)";
entryPoints = [
"websecure"
];
service = "lighttpd";
};
};
services.traefik.dynamicConfigOptions.http.services = {
lighttpd.loadBalancer.servers = [
{url = "http://127.0.0.1:${toString config.services.lighttpd.port}";}
];
};
fileSystems."/srv/lighttpd" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [
"subvol=srv-lighttpd"
"compress=zstd"
];
};
}