nix: format with alejandra

This commit is contained in:
Primrose 2025-02-08 12:05:12 +01:00
parent d5cad148da
commit 95eb4b71e0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
118 changed files with 1291 additions and 1703 deletions

View file

@ -1,73 +1,65 @@
{ config, ... }:
{
services.restic.backups =
let
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 12"
"--keep-yearly 10"
{config, ...}: {
services.restic.backups = let
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 12"
"--keep-yearly 10"
];
in {
"Documents-backblaze" = {
paths = [
"/home/leana/Documents"
"/home/leana/Calibre"
];
in
{
"Documents-backblaze" = {
paths = [
"/home/leana/Documents"
"/home/leana/Calibre"
];
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
environmentFile = config.age.secrets.restic_backblaze_env.path;
inherit pruneOpts;
};
"four" = {
paths = [
"/home/leana/Music"
"/home/leana/Documents"
"/home/leana/Calibre"
"/home/leana/Images"
];
repository = "/mnt/four/restic";
passwordFile = config.age.secrets.restic_four_pwd.path;
timerConfig = {
OnCalendar = "02:00";
};
inherit pruneOpts;
};
"two-to-four" = {
paths = [ "/mnt/two" ];
timerConfig = null;
repository = "/mnt/four/restic";
passwordFile = config.age.secrets.restic_four_pwd.path;
exclude = [ "lost+found" ];
inherit pruneOpts;
};
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
environmentFile = config.age.secrets.restic_backblaze_env.path;
inherit pruneOpts;
};
systemd.services = {
"four" = {
paths = [
"/home/leana/Music"
"/home/leana/Documents"
"/home/leana/Calibre"
"/home/leana/Images"
];
repository = "/mnt/four/restic";
passwordFile = config.age.secrets.restic_four_pwd.path;
timerConfig = {
OnCalendar = "02:00";
};
inherit pruneOpts;
};
"two-to-four" = {
paths = ["/mnt/two"];
timerConfig = null;
repository = "/mnt/four/restic";
passwordFile = config.age.secrets.restic_four_pwd.path;
exclude = ["lost+found"];
inherit pruneOpts;
};
};
systemd.services = {
# TODO:
# Wait for upstream to introduce direct access to unitConfig
# c.f. https://github.com/NixOS/nixpkgs/pull/368234
"restic-backups-four" = {
requires = [ "mnt-four.mount" ];
after = [ "mnt-four.mount" ];
unitConfig.PropagatesStopTo = [ "mnt-four.mount" ];
requires = ["mnt-four.mount"];
after = ["mnt-four.mount"];
unitConfig.PropagatesStopTo = ["mnt-four.mount"];
};
"restic-backups-two-to-four" = {
@ -84,7 +76,5 @@
"mnt-four.mount"
];
};
};
}