summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@sif/systemd.nix13
1 files changed, 12 insertions, 1 deletions
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
44in { 44in {
45 services = { 45 services = {
46 sync-keepass = { 46 sync-keepass = {
47 path = with pkgs; [ rclone ];
47 Service = { 48 Service = {
48 Type = "oneshot"; 49 Type = "oneshot";
49 WorkingDirectory = "~"; 50 WorkingDirectory = "~";
50 ExecStart = "${pkgs.lftp}/bin/lftp -f ${./store.kdbx.lftp}"; 51 ExecStart = pkgs.writers.writePython3 "sync-keepass" {} ''
52 import json
53 import subprocess
54 from datetime import datetime
55
56 res = None
57 with subprocess.Popen(['rclone', 'lsjson', 'surtr:store.kdbx'], stdout=subprocess.PIPE) as proc:
58 res = json.load(proc.stdout)
59 print(res)
60 '';
61 Environment = "RCLONE_PASSWORD_COMMAND=\"cat ${config.sops.secrets.gkleen-rclone.path}\"";
51 }; 62 };
52 }; 63 };
53 emacs = { 64 emacs = {