fix(youko): wait for data mounts before tmpfiles setup (#498)

systemd-tmpfiles-setup only orders itself after local-fs.target, but the nofail /data submounts can complete later. It then sees /data as the read-only fallback tmpfs and fails to create the Transmission, Immich, RustFS and restic directories at boot.

Add RequiresMountsFor for the data mounts and cover the generated unit dependency with an eval test.
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-11-01 16:36:00 +08:00
1 parent c277c81cd6
commit 89d7a9bd82
3 files changed
+33

No files matched your search

@@ -0,0 +1,10 @@
{ ... }:
{
requiresMountsFor = [
"/data/apps"
"/data/apps-snapshots"
"/data/backups"
"/data/fileshare"
"/data/fileshare/public"
];
}
@@ -0,0 +1,11 @@
{
lib,
outputs,
...
}:
let
unit = outputs.nixosConfigurations.youko.config.systemd.services.systemd-tmpfiles-setup;
in
{
requiresMountsFor = builtins.sort builtins.lessThan unit.unitConfig.RequiresMountsFor;
}