mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 19:00:14 +00:00
backups and fish functions
This commit is contained in:
@ -60,7 +60,7 @@ in
|
||||
users.users.${config.user}.extraGroups = [ "calibre-web" ];
|
||||
|
||||
# Run a backup on a schedule
|
||||
systemd.timers.calibre-backup = lib.mkIf config.backups.calibre {
|
||||
systemd.timers.calibre-backup = {
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 00:00:00"; # Once per day
|
||||
Unit = "calibre-backup.service";
|
||||
@ -71,7 +71,7 @@ in
|
||||
# Backup Calibre data to object storage
|
||||
systemd.services.calibre-backup = {
|
||||
description = "Backup Calibre data";
|
||||
environment.AWS_ACCESS_KEY_ID = config.backup.s3.accessKeyId;
|
||||
environment.AWS_ACCESS_KEY_ID = config.nmasur.presets.services.litestream.s3.accessKeyId;
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "calibre-web";
|
||||
@ -81,8 +81,8 @@ in
|
||||
script = ''
|
||||
${pkgs.awscli2}/bin/aws s3 sync \
|
||||
${libraryPath}/ \
|
||||
s3://${config.backup.s3.bucket}/calibre/ \
|
||||
--endpoint-url=https://${config.backup.s3.endpoint}
|
||||
s3://${config.nmasur.presets.services.litestream.s3.bucket}/calibre/ \
|
||||
--endpoint-url=https://${config.nmasur.presets.services.litestream.s3.endpoint}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user