fix backup auto-mount

This commit is contained in:
Tim Schubert 2023-01-22 20:18:15 +01:00
parent c5a07ff3cb
commit bde44cff9b
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
3 changed files with 19 additions and 8 deletions

View file

@ -60,15 +60,24 @@ in
}; };
config = { config = {
fileSystems = mkIf cfg.gs.enable { systemd.mounts = mkIf cfg.gs.enable [
"/backup" = { {
device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5"; type = "ext4";
fsType = "ext4"; what = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5";
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ]; where = "/backup";
}; options = "nofail noauto";
}; }
];
systemd.automounts = mkIf cfg.gs.enable [
{
where = "/backup";
automountConfig.TimeoutIdleSec = "600";
}
];
services.borgbackup.jobs.gs = mkIf cfg.gs.enable { services.borgbackup.jobs.gs = mkIf cfg.gs.enable {
removableDevice = true;
paths = "/"; paths = "/";
exclude = backupExcludes; exclude = backupExcludes;
repo = "/backup/${config.networking.hostName}"; repo = "/backup/${config.networking.hostName}";
@ -88,6 +97,8 @@ in
startAt = "monthly"; startAt = "monthly";
}; };
systemd.services."borgbackup-job-gs".enable = false;
systemd.services."borgbackup-job-gs".wants = [ "backup.mount" ];
systemd.timers."borgbackup-job-gs".enable = false; systemd.timers."borgbackup-job-gs".enable = false;
services.borgbackup.jobs.bs = mkIf cfg.bs.enable { services.borgbackup.jobs.bs = mkIf cfg.bs.enable {

View file

@ -18,7 +18,7 @@ in
"pruflas-wg-hydra-key.age".publicKeys = [ systems.pruflas dadada ]; "pruflas-wg-hydra-key.age".publicKeys = [ systems.pruflas dadada ];
"hydra-github-authorization.age".publicKeys = [ systems.pruflas dadada ]; "hydra-github-authorization.age".publicKeys = [ systems.pruflas dadada ];
"miniflux-admin-credentials.age".publicKeys = [ systems.surgat dadada ]; "miniflux-admin-credentials.age".publicKeys = [ systems.surgat dadada ];
"gorgon-backup-gs-passphrase.age".publicKeys = [ systems.gorgon dadada ]; "gorgon-backup-passphrase-gs.age".publicKeys = [ systems.gorgon dadada ];
} // } //
backupSecrets "gorgon" // backupSecrets "gorgon" //
backupSecrets "ifrit" // backupSecrets "ifrit" //