fix(aquamarine): persist the user's cache directory (#466)

On a tmpfs root the flake/fetch cache is empty at every boot, so
`nix run <flake-ref>` re-downloads its input and fails until DNS is up: a reboot
test showed llama-swap's first start failing on that. Other caches write into
RAM meanwhile.

Assisted-by: DeepSeek Harness (deepseek-flash)
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-10-16 21:36:00 +08:00
1 parent e42d7adc88
commit 3d38ff7433
3 files changed
+18 -4

No files matched your search

@@ -8,6 +8,7 @@
cStatesCapped = true;
nativeIpv6Preference = true;
sourceCheckoutsPersistent = true;
cachePersistent = true;
userUnitDirsPersistent = true;
rootlessPodmanEnabled = true;
stableKernel = true;
@@ -37,6 +37,11 @@ in
d: d.directory == "/home/${myvars.username}/src"
) cfg.preservation.preserveAt."/persistent".users.${myvars.username}.directories;
# A cold flake cache re-downloads the input of a `nix run <flake-ref>` at boot.
cachePersistent = builtins.any (
d: d.directory == "/home/${myvars.username}/.cache"
) cfg.preservation.preserveAt."/persistent".users.${myvars.username}.directories;
# Directories the tmpfs root would otherwise drop.
userUnitDirsPersistent =
let