From 2b034f332126efbfc410c0b8ef2b2706d71032ef Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Thu, 3 Oct 2024 11:30:33 -0400 Subject: [PATCH] Note backup service --- modules/users/crow/user.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/users/crow/user.nix b/modules/users/crow/user.nix index 99c94a8..578e73d 100644 --- a/modules/users/crow/user.nix +++ b/modules/users/crow/user.nix @@ -5,5 +5,27 @@ extraGroups = [ "wheel" "networkmanager" "audio" ]; }; + config.systemd.services.note_sync = { + enable = true; + description = "Auto sync notes to remote"; + unitConfig = { + User = "crow"; + Group = "crow"; + Type = "oneshot"; + }; + script = "cd /home/crow/Notes\ngit add .\ngit commit -am 'automatic backup'\ngit push"; + }; + config.systemd.timers.note_sync = { + enable = true; + description = "Timer to autosync notes"; + timerConfig = { + OnCalendar = "*:0/5"; + Persistent = true; + }; + wantedBy = [ + timers.target + ]; + }; + config.home-manager.users.crow = lib.mkIf config.users.crow.home.enable ./home.nix; }