CrOS/modules/services/note-sync.nix
2025-01-20 18:14:32 -05:00

21 lines
479 B
Nix

{
config,
lib,
...
}: lib.mkIf config.service.note-sync.enable {
config.systemd.services.note_sync = {
enable = true;
description = "Auto sync notes to remote";
serviceConfig = {
User = "crow";
Type = "oneshot";
};
path = [
"/run/current-system/sw"
];
startAt = [
"*:0/5"
];
script = "cd /home/crow/Notes\ngit pull\ngit add .\ngit diff-index --quiet HEAD || git commit -am 'automatic backup'\ngit push";
};
}