mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
committed by
Austin Horstman
parent
fd3a68e640
commit
d4e015754e
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user