mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:36 +01:00
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:
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;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user