refactor overseer backup solution

This commit is contained in:
TheWanderingCrow 2025-03-18 08:55:28 -04:00
parent 3cfa86c8b8
commit 11ba348a58
7 changed files with 34 additions and 103 deletions

View file

@ -0,0 +1,33 @@
let
volumePath = "/overseer/services";
in
{
lib,
config,
...
}:
lib.mkIf config.user.overseer.enable {
services.restic.backups.borg-base = {
user = "root";
timerConfig = {
OnCalendar = "hourly";
Persistent = true;
};
paths = [
# bar-assistant.nix
"${volumePath}/bar-assistant"
"${volumePath}/meilisearch"
# homebox.nix
"/var/lib/homebox/data"
# lubelogger.nix
"${volumePath}/lubelogger"
# trilium.nix
"/var/lib/trilium/backup"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
}

View file

@ -4,6 +4,7 @@
./setup.nix
./secrets.nix
./acme.nix
./backups.nix
./services
];
}

View file

@ -63,23 +63,6 @@ in
};
};
##########
# Backup #
##########
services.restic.backups.bar-assistant = {
user = "root";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
paths = [
"${volumePath}/bar-assistant"
"${volumePath}/meilisearch"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
###########
# Service #
###########

View file

@ -1,47 +0,0 @@
let
volumePath = "/overseer/services";
in
{
lib,
pkgs,
config,
...
}:
lib.mkIf config.user.overseer.enable {
sops.secrets."bookstack/key" = {
owner = "bookstack";
};
services.restic.backups.bookstack = {
user = "root";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
backupPrepareCommand = "${pkgs.mariadb}/bin/mysqldump -u root bookstack > ${volumePath}/tmp/bookstack.sql";
backupCleanupCommand = "rm ${volumePath}/tmp/bookstack.sql";
paths = [
"/var/lib/bookstack"
"${volumePath}/tmp/bookstack.sql"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
services.bookstack = {
enable = true;
hostname = "bookstack.wanderingcrow.net";
database.createLocally = true;
appKeyFile = config.sops.secrets."bookstack/key".path;
nginx = {
forceSSL = true;
extraConfig = ''
allow 192.168.0.0/16;
allow 10.8.0.0/24;
allow 24.179.20.202;
deny all;
'';
useACMEHost = "bookstack.wanderingcrow.net";
};
};
}

View file

@ -5,19 +5,6 @@
}:
lib.mkIf config.user.overseer.enable {
services = {
restic.backups.homebox = {
user = "root";
timerConfig = {
OnCalendar = "hourly";
Persistent = true;
};
paths = [
"/var/lib/homebox/data"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
nginx = {
enable = true;
recommendedProxySettings = true;

View file

@ -16,19 +16,6 @@ in
# Service #
###########
services.restic.backups.bar-assistant = {
user = "root";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
paths = [
"${volumePath}/lubelogger"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
sops = {
secrets = {
"lubelogger/user_hash" = {};

View file

@ -6,19 +6,6 @@
}:
lib.mkIf config.user.overseer.enable {
services = {
restic.backups.notes = {
user = "root";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
paths = [
"/var/lib/trilium/backup"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
trilium-server = {
enable = true;
package = pkgs.trilium-next-server;