diff --git a/home/default.nix b/home/default.nix index 2565d6e..424fac0 100644 --- a/home/default.nix +++ b/home/default.nix @@ -18,6 +18,7 @@ ./packages ./hyprland ./ssh + ./services/backup-home.nix ]; firefox.enable = true; tmux.enable = true; diff --git a/home/services/backup-home.nix b/home/services/backup-home.nix new file mode 100644 index 0000000..7a9a173 --- /dev/null +++ b/home/services/backup-home.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + systemd.user.services.backup-home = { + Unit = { + Description = "Backup home directory"; + After = [ "network.target" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "/home/torjus/.local/bin/backup-home"; + }; + }; + systemd.user.timers.backup-home = { + Unit = { + Description = "Backup home directory"; + After = [ "network.target" ]; + }; + Timer = { + OnCalendar = "*-*-* 00:00:00"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; +}