diff --git a/lib/modules/rclone.nix b/lib/modules/rclone.nix index 2304dbc..ceeefd3 100644 --- a/lib/modules/rclone.nix +++ b/lib/modules/rclone.nix @@ -374,7 +374,16 @@ in { (lib.generators.toINI { } { ${name} = sync.config; }); script = pkgs.writeShellScriptBin serviceName '' ${sync.secretsScript} - cat ${configFile} + mkdir -p ${lib.escapeShellArg sync.path} + mkdir -p /tmp/rclone + ${lib.getExe pkgs.rclone} mount --config ${configFile} ${name}: ${lib.escapeShellArg sync.path} + ''; + in + (lib.getExe script); + ExecStop = + let + script = pkgs.writeShellScriptBin "${serviceName}-stop" '' + furermount -zu ${sync.path} ''; in (lib.getExe script);