Implement proper command for mounting and unmounting rclone

This commit is contained in:
Manuel Thalmann 2024-05-16 02:23:28 +02:00
parent 7693faf903
commit f3e84b8e02

View file

@ -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);