tsuki: init immich backup service

This commit is contained in:
notohh 2025-02-18 08:18:27 -05:00
parent 5f3b25b4df
commit f625eae63e
Signed by: notohh
GPG key ID: BD47506D475EE86D
2 changed files with 34 additions and 0 deletions
hosts/tsuki/services

View file

@ -4,5 +4,6 @@
./atticd.nix
./hydroxide.nix
./rnnoise.nix
./immich-backup.nix
];
}

View file

@ -0,0 +1,33 @@
{
lib,
pkgs,
...
}: {
systemd = {
services.immich-backup = let
homeDir = "/home/notoh";
in {
enable = true;
wantedBy = ["multi-user.target"];
description = "immich backup service";
script = ''
${lib.getExe pkgs.immich-cli} upload --album-name "screenshots" --recursive ${homeDir}/Pictures/screenshots
'';
environment = {
IMMICH_CONFIG_DIR = "${homeDir}/.config/immich";
};
};
timers.immich-backup = {
enable = true;
wantedBy = ["timers.target"];
description = "immich backup timer";
timerConfig = {
OnCalendar = "*-*-* 00:00:00";
Persistent = true;
};
unitConfig = {
Description = "immich backup timer";
};
};
};
}