From f3e84b8e02b36f7c4395774c2e7944542a20fd67 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 16 May 2024 02:23:28 +0200 Subject: [PATCH] Implement proper command for mounting and unmounting `rclone` --- lib/modules/rclone.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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);