23 current 2025-10-07 14:49:54 25.05.20251001.5b5be50 6.12.49 *
This commit is contained in:
@@ -29,6 +29,7 @@ in
|
|||||||
config = lib.mkIf (backup_paths != []) {
|
config = lib.mkIf (backup_paths != []) {
|
||||||
systemd.services.backups = {
|
systemd.services.backups = {
|
||||||
description = "backup service with borg!";
|
description = "backup service with borg!";
|
||||||
|
path = [ pkgs.borgbackup ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
EnvironmentFile = config.modules.system.backups.passphraseFile;
|
EnvironmentFile = config.modules.system.backups.passphraseFile;
|
||||||
@@ -39,7 +40,7 @@ in
|
|||||||
|
|
||||||
# Initialize repo if it doesn't exist
|
# Initialize repo if it doesn't exist
|
||||||
if ! borg info "$BORG_REPO" >/dev/null 2>&1; then
|
if ! borg info "$BORG_REPO" >/dev/null 2>&1; then
|
||||||
mkdir -p "$BORG_REPO"
|
# mkdir -p "$BORG_REPO"
|
||||||
echo "init borg repo at $BORG_REPO"
|
echo "init borg repo at $BORG_REPO"
|
||||||
borg init --encryption=repokey "$BORG_REPO"
|
borg init --encryption=repokey "$BORG_REPO"
|
||||||
fi
|
fi
|
||||||
@@ -77,7 +78,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ borgbackup ];
|
environment.systemPackages = [ pkgs.borgbackup ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user