mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Setup backup for storage1
This commit is contained in:
parent
f56c03dcdc
commit
8d31683aa0
3 changed files with 21 additions and 3 deletions
|
|
@ -25,7 +25,7 @@
|
|||
readWritePaths = [ "/nix/var/data/murmur" ];
|
||||
preHook = "cp /var/lib/murmur/murmur.sqlite /nix/var/data/murmur/murmur.sqlite";
|
||||
startAt = "03:30";
|
||||
sshKey = config.sops.secrets.borgPassphrase.path;
|
||||
sshKey = config.sops.secrets.borgSshKey.path;
|
||||
};
|
||||
|
||||
networking.interfaces.enp1s0 = {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,16 @@
|
|||
../modules/stb.nix
|
||||
../modules/monero.nix
|
||||
../modules/torrents.nix
|
||||
../modules/custom-backup-job.nix
|
||||
];
|
||||
|
||||
sops.secrets = {
|
||||
borgSshKey = {
|
||||
owner = config.services.borgbackup.jobs.data.user;
|
||||
key = "borg/client_keys/storage1/private";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 18080 ];
|
||||
|
||||
networking.nat.enable = true;
|
||||
|
|
@ -33,4 +41,11 @@
|
|||
group = config.users.groups.steam.name;
|
||||
};
|
||||
users.groups.steam = { };
|
||||
|
||||
services.custom-backup-job = {
|
||||
readWritePaths = [ "/nix/var/data/backup" ];
|
||||
preHook = "${pkgs.docker}/bin/docker exec stb-mariadb sh -c 'mysqldump -u stb -pstb stb' > /nix/var/data/backup/stb_mariadb.sql";
|
||||
startAt = "04:00";
|
||||
sshKey = config.sops.secrets.borgSshKey.path;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue