From af763b3783d685346cff6e3ce1557a5d962b52b1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 31 Jan 2022 19:26:00 +0100 Subject: ... --- accounts/gkleen@sif/systemd.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'accounts') diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index 6bb8cf8e..4ed75e85 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix @@ -44,10 +44,21 @@ let in { services = { sync-keepass = { + path = with pkgs; [ rclone ]; Service = { Type = "oneshot"; WorkingDirectory = "~"; - ExecStart = "${pkgs.lftp}/bin/lftp -f ${./store.kdbx.lftp}"; + ExecStart = pkgs.writers.writePython3 "sync-keepass" {} '' + import json + import subprocess + from datetime import datetime + + res = None + with subprocess.Popen(['rclone', 'lsjson', 'surtr:store.kdbx'], stdout=subprocess.PIPE) as proc: + res = json.load(proc.stdout) + print(res) + ''; + Environment = "RCLONE_PASSWORD_COMMAND=\"cat ${config.sops.secrets.gkleen-rclone.path}\""; }; }; emacs = { -- cgit v1.2.3