fix(mihomo): order the service after its config mount (#382)

The config deliberately stays out of the store, under the home directory, which is a persistent bind mount on tmpfs-root hosts. When the service and the mount are introduced in the same activation, mihomo can start before the mount is up and fail with "Failed to set up credentials: No such file or directory", making the switch report status 4. Add RequiresMountsFor so the mount is brought up and ordered before the service.
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-10-05 01:08:08 +08:00
1 parent 502d0c85c7
commit b8348bf276
1 file changed
+6
@@ -31,5 +31,11 @@ in
webui = pkgs.metacubexd;
tunMode = true;
};
# The config deliberately stays out of the store, under the user's home. On
# tmpfs-root hosts that path is a persistent bind mount, so make the service
# wait for it: otherwise activation can start mihomo before the mount is up
# and fail with "Failed to set up credentials: No such file or directory".
systemd.services.mihomo.unitConfig.RequiresMountsFor = builtins.dirOf configFile;
};
}