rclone: add launchd config agent for Darwin

Renders rclone.conf at login on macOS using the same secret-injection
script as the Linux systemd path. Retries on failure via
KeepAlive.Crashed=true.
This commit is contained in:
jiezhuzzz
2026-05-05 21:38:45 -05:00
committed by Austin Horstman
parent fd3a68e640
commit d4e015754e

View File

@@ -542,6 +542,22 @@ in
Install.WantedBy = [ "default.target" ];
};
};
mkLaunchdConfigService = lib.mkIf (cfg.remotes != { }) {
rclone-config = {
enable = true;
config = {
ProgramArguments = [ (lib.getExe rcloneConfigScript) ];
RunAtLoad = true;
KeepAlive = {
SuccessfulExit = false;
Crashed = true;
};
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/rclone/rclone-config.log";
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/rclone/rclone-config.err.log";
};
};
};
in
lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
@@ -550,5 +566,8 @@ in
(mkRcloneSidecars "mounts" mkSystemdSidecar)
(mkRcloneSidecars "serve" mkSystemdSidecar)
];
launchd.agents = lib.mkMerge [
mkLaunchdConfigService
];
};
}