tsuki: init immich backup service
This commit is contained in:
parent
5f3b25b4df
commit
f625eae63e
2 changed files with 34 additions and 0 deletions
hosts/tsuki/services
|
@ -4,5 +4,6 @@
|
||||||
./atticd.nix
|
./atticd.nix
|
||||||
./hydroxide.nix
|
./hydroxide.nix
|
||||||
./rnnoise.nix
|
./rnnoise.nix
|
||||||
|
./immich-backup.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
33
hosts/tsuki/services/immich-backup.nix
Normal file
33
hosts/tsuki/services/immich-backup.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue