Add backups for Lappy-T495
This commit is contained in:
parent
bde2d41b9f
commit
0e271b08c4
|
@ -21,6 +21,7 @@ in {
|
||||||
restic_owncast = restic + 8;
|
restic_owncast = restic + 8;
|
||||||
restic_jellyfin = restic + 9;
|
restic_jellyfin = restic + 9;
|
||||||
restic_grocy = restic + 10;
|
restic_grocy = restic + 10;
|
||||||
|
restic_lappy_t495 = restic + 11;
|
||||||
|
|
||||||
http_music = http + 0;
|
http_music = http + 0;
|
||||||
http_public = http + 1;
|
http_public = http + 1;
|
||||||
|
|
|
@ -125,6 +125,7 @@ in {
|
||||||
"/Owncast/".proxyPass = "http://${containerIP}:${toString ports.restic_owncast}";
|
"/Owncast/".proxyPass = "http://${containerIP}:${toString ports.restic_owncast}";
|
||||||
"/Jellyfin/".proxyPass = "http://${containerIP}:${toString ports.restic_jellyfin}";
|
"/Jellyfin/".proxyPass = "http://${containerIP}:${toString ports.restic_jellyfin}";
|
||||||
"/Grocy/".proxyPass = "http://${containerIP}:${toString ports.restic_grocy}";
|
"/Grocy/".proxyPass = "http://${containerIP}:${toString ports.restic_grocy}";
|
||||||
|
"/Lappy-T495/".proxyPass = "http://${containerIP}:${toString ports.restic_lappy_t495}";
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size ${clientMaxBodySize};
|
client_max_body_size ${clientMaxBodySize};
|
||||||
|
|
|
@ -233,6 +233,16 @@ in {
|
||||||
"--baseurl=/Grocy/"
|
"--baseurl=/Grocy/"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
id = "restic-lappy-t495";
|
||||||
|
remote = "StorageBox:Backups/Restic/Lappy-T495";
|
||||||
|
type = "restic";
|
||||||
|
extraArgs = [
|
||||||
|
"--addr=0.0.0.0:${toString ports.restic_lappy_t495}"
|
||||||
|
"--htpasswd=${secrets.restic_lappy_t495_htpasswd.path}"
|
||||||
|
"--baseurl=/Lappy-T495/"
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
"api-keys/data/storage/restic/Owncast"
|
"api-keys/data/storage/restic/Owncast"
|
||||||
"api-keys/data/storage/restic/Jellyfin"
|
"api-keys/data/storage/restic/Jellyfin"
|
||||||
"api-keys/data/storage/restic/Grocy"
|
"api-keys/data/storage/restic/Grocy"
|
||||||
|
"api-keys/data/storage/restic/Lappy-T495"
|
||||||
|
|
||||||
"api-keys/data/storage/webdav/Main"
|
"api-keys/data/storage/webdav/Main"
|
||||||
"api-keys/data/storage/webdav/Media"
|
"api-keys/data/storage/webdav/Media"
|
||||||
|
@ -191,6 +192,14 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
restic_lappy_t495_htpasswd = {
|
||||||
|
user = "storage";
|
||||||
|
group = "storage";
|
||||||
|
fetchScript = ''
|
||||||
|
simple_get_htpasswd "/api-keys/storage/restic/Lappy-T495" "$secretFile"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
webdav_main_htpasswd = {
|
webdav_main_htpasswd = {
|
||||||
user = "storage";
|
user = "storage";
|
||||||
group = "storage";
|
group = "storage";
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
profiles.gaming.steam
|
profiles.gaming.steam
|
||||||
|
|
||||||
|
hosts.lappy-t495.profiles.restic
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
28
hosts/lappy-t495/profiles/restic.nix
Normal file
28
hosts/lappy-t495/profiles/restic.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{config, ...}: let
|
||||||
|
secrets = config.services.secrets.secrets;
|
||||||
|
in {
|
||||||
|
services.restic.backups.lappy-t495 = {
|
||||||
|
user = "root";
|
||||||
|
createWrapper = true;
|
||||||
|
|
||||||
|
paths = [
|
||||||
|
"/etc/NetworkManager/system-connections"
|
||||||
|
"/home/chaos/Projects"
|
||||||
|
];
|
||||||
|
extraBackupArgs = [
|
||||||
|
"--exclude-caches"
|
||||||
|
"--exclude=node_modules"
|
||||||
|
"--exclude=/home/chaos/Projects/*/target"
|
||||||
|
];
|
||||||
|
|
||||||
|
repositoryFile = "${secrets.restic_backups_repository_file.path}";
|
||||||
|
passwordFile = "${secrets.restic_backups_password.path}";
|
||||||
|
|
||||||
|
pruneOpts = ["--keep-within=14d"];
|
||||||
|
|
||||||
|
timerConfig = {
|
||||||
|
OnStartupSec = "5m";
|
||||||
|
OnUnitActiveSec = "30m";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -27,6 +27,20 @@
|
||||||
echo "RESTIC_PASSWORD=''${restic_password}" >> "$secretFile"
|
echo "RESTIC_PASSWORD=''${restic_password}" >> "$secretFile"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
restic_backups_password = {
|
||||||
|
fetchScript = ''
|
||||||
|
simple_get "/private-public-keys/restic/Lappy-T495" .password >> "$secretFile"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
restic_backups_repository_file = {
|
||||||
|
fetchScript = ''
|
||||||
|
api_username=restic
|
||||||
|
api_password=$(simple_get "/api-keys/storage/restic/Lappy-T495" ".$api_username")
|
||||||
|
|
||||||
|
echo "rest:https://$api_username:$api_password@storage-restic.owo.monster/Lappy-T495" > "$secretFile"
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue