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

@ -17,5 +17,28 @@ in {
users.users.sako.packages = with pkgs; [ users.users.sako.packages = with pkgs; [
(pass.withExtensions (pkgs: with pkgs; [pass-otp pass-import pass-genphrase pass-checkup])) (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";
};
};
}; };
} }