add pass-sync timer

This commit is contained in:
Sakooooo 2024-06-15 11:36:38 +00:00
parent f3c62fd391
commit ae96c9dd78
Signed by: sako
GPG key ID: FE52FD65B76E4751
2 changed files with 32 additions and 9 deletions

View file

@ -540,14 +540,14 @@ TODO
#+end_src
** Password-Store
#+begin_src emacs-lisp
(use-package password-store
(use-package password-store
:bind (("C-c p p" . password-store-copy)
("C-c p i" . password-store-insert)
("C-c p g" . password-store-generate))
:config
(setq password-store-password-length 12))
(use-package auth-source-pass
(use-package auth-source-pass
:config
(auth-source-pass-enable))
#+end_src

View file

@ -17,5 +17,28 @@ in {
users.users.sako.packages = with pkgs; [
(pass.withExtensions (pkgs: with pkgs; [pass-otp pass-import pass-genphrase pass-checkup]))
];
# systemd timer to run git pull and git push
systemd.timers."pass-sync" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1m";
OnUnitActiveSec = "1h";
Unit = "pass-sync.service";
};
};
systemd.services."pass-sync" = {
script = ''
set -eu
${pkgs.coreutils}/bin/echo "Hello World"
${pkgs.pass}/bin/pass git pull
${pkgs.pass}/bin/pass git push
'';
serviceConfig = {
Type = "oneshot";
User = "sako";
};
};
};
}