about summary refs log tree commit diff
path: root/users/fcuny
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-02-12 14:29:07 -0800
committerFranck Cuny <franck@fcuny.net>2022-02-12 14:29:07 -0800
commit1da81c2542e0a1eefaf4930366fb8416609d9010 (patch)
treed6e90d5039723b10dfe2101bc4da56cebcc0310b /users/fcuny
parenthome-manager: typo (diff)
downloadworld-1da81c2542e0a1eefaf4930366fb8416609d9010.tar.gz
home-manager: push password-store to git
Add a systemd timer and an unit to push the content of the password
store to our git remote.
Diffstat (limited to 'users/fcuny')
-rw-r--r--users/fcuny/desktop/trust/pass.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/users/fcuny/desktop/trust/pass.nix b/users/fcuny/desktop/trust/pass.nix
index d430ec8..f8c81a1 100644
--- a/users/fcuny/desktop/trust/pass.nix
+++ b/users/fcuny/desktop/trust/pass.nix
@@ -5,4 +5,32 @@
 
   programs.password-store.settings.PASSWORD_STORE_DIR =
     "${config.xdg.dataHome}/password-store";
+
+  systemd.user.services.git-password-store = {
+    Unit = {
+      Description = "password-store synchronization service";
+      Documentation = [
+        "man:pass(1)"
+        "https://git.fcuny.net/fcuny/password-store"
+      ];
+      ConditionPathIsDirectory = "%h/.local/share/password-store/.git"
+    };
+    Service = {
+      Type = "oneshot";
+      WorkingDirectory = "%h/.local/share/password-store/.git",
+      ExecStart = "${pkgs.git}/bin/git push origin %H";
+    };
+  };
+
+  systemd.user.timers.git-password-store = {
+    Unit = {
+      Description = "password-store synchronization timer";
+      Documentation = "man:pass(1)";
+    };
+    Timer = {
+      OnBootSec = "20m";
+      OnUnitActiveSec = "60m";
+    };
+    Install = { WantedBy = [ "timers.target" ]; };
+  };
 }