Add backup home service and timer

This commit is contained in:
Torjus Håkestad 2024-03-05 09:27:58 +01:00
parent 5f48a0ab51
commit 03cbf084e0
2 changed files with 26 additions and 0 deletions

View File

@ -18,6 +18,7 @@
./packages
./hyprland
./ssh
./services/backup-home.nix
];
firefox.enable = true;
tmux.enable = true;

View File

@ -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" ];
};
};
}