From c8d8b17a2781107309ec8a59f5e974888e21fe93 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Mon, 2 Nov 2026 01:01:51 +0800 Subject: [PATCH] refactor(youko): link caddy's wallpapers with tmpfiles A tmpfiles L+ symlink to the store path replaces the activation script that rsynced it on every switch. Files that were removed upstream no longer linger. Assisted-by: Claude Code (claude-opus-5-5) --- hosts/12kingdoms-youko/homelab-services/caddy.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hosts/12kingdoms-youko/homelab-services/caddy.nix b/hosts/12kingdoms-youko/homelab-services/caddy.nix index b56f2413..e450ead1 100644 --- a/hosts/12kingdoms-youko/homelab-services/caddy.nix +++ b/hosts/12kingdoms-youko/homelab-services/caddy.nix @@ -1,6 +1,5 @@ { mylib, - pkgs, config, myvars, wallpapers, @@ -253,10 +252,5 @@ in # caddy is reached from the LAN/tailnet only; the shared firewall # (modules/nixos/base/networking/firewall.nix) already trusts those. - # Serve the wallpapers from the file server. `mkdir -p` here covers the - # whole fileserver tree; caddy's dataDir itself is created by the module. - system.activationScripts.installCaddyWallpapers = '' - mkdir -p /var/lib/caddy/fileserver/wallpapers - ${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F644 ${wallpapers}/ /var/lib/caddy/fileserver/wallpapers/ - ''; + systemd.tmpfiles.rules = [ "L+ /var/lib/caddy/fileserver/wallpapers - - - - ${wallpapers}" ]; }