add pass-sync timer
This commit is contained in:
parent
f3c62fd391
commit
ae96c9dd78
2 changed files with 32 additions and 9 deletions
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue