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)
This commit is contained in:
Ryan Yin authored and ryan4yin | 二花 committed 2026-11-01 11:42:57 -06:00
1 parent 5c9bb6f95f
commit c8d8b17a27
1 file changed
+1 -7
@@ -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}" ];
}