backups: refactor and add renoir
This commit is contained in:
parent
e729d38637
commit
c7ec1a5423
3 changed files with 42 additions and 38 deletions
41
clan/backups.nix
Normal file
41
clan/backups.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, self, ... }:
|
||||
{
|
||||
clan.inventory.instances."borgbackup-storagebox" = {
|
||||
module.input = "clan-core";
|
||||
module.name = "borgbackup";
|
||||
|
||||
roles.client.machines = lib.genAttrs [ "crocus" "genepi" "renoir" "verbena" ] (
|
||||
machine:
|
||||
let
|
||||
config = self.nixosConfigurations.${machine}.config;
|
||||
user = "u422292";
|
||||
host = "${user}.your-storagebox.de";
|
||||
in
|
||||
{
|
||||
settings.destinations."storagebox-${config.networking.hostName}" = {
|
||||
repo = "${user}@${host}:./borgbackup/${config.networking.hostName}";
|
||||
rsh = "ssh -oPort=23 -i ${
|
||||
config.clan.core.vars.generators.borgbackup.files."borgbackup.ssh".path
|
||||
} -oStrictHostKeyChecking=accept-new";
|
||||
};
|
||||
}
|
||||
);
|
||||
roles.client.extraModules = [
|
||||
{
|
||||
programs.ssh.knownHosts =
|
||||
let
|
||||
user = "u422292";
|
||||
host = "${user}.your-storagebox.de";
|
||||
in
|
||||
{
|
||||
storagebox-ed25519 = {
|
||||
hostNames = [ "[${host}]:23" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
];
|
||||
roles.server.machines = { };
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{ self, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./backups.nix
|
||||
./machines.nix
|
||||
./monitoring.nix
|
||||
./network.nix
|
||||
|
|
@ -89,32 +90,6 @@
|
|||
roles.default.tags.all = { };
|
||||
};
|
||||
|
||||
clan.inventory.instances."borgbackup-storagebox" = {
|
||||
module.input = "clan-core";
|
||||
module.name = "borgbackup";
|
||||
|
||||
roles.client.machines = lib.genAttrs [ "crocus" "genepi" "verbena" ] (
|
||||
machine:
|
||||
let
|
||||
config = self.nixosConfigurations.${machine}.config;
|
||||
user = "u422292";
|
||||
host = "${user}.your-storagebox.de";
|
||||
in
|
||||
{
|
||||
settings.destinations."storagebox-${config.networking.hostName}" = {
|
||||
repo = "${user}@${host}:./borgbackup/${config.networking.hostName}";
|
||||
rsh = "ssh -oPort=23 -i ${
|
||||
config.clan.core.vars.generators.borgbackup.files."borgbackup.ssh".path
|
||||
} -oStrictHostKeyChecking=accept-new";
|
||||
};
|
||||
}
|
||||
);
|
||||
roles.client.extraModules = [
|
||||
self.nixosModules.storagebox
|
||||
];
|
||||
roles.server.machines = { };
|
||||
};
|
||||
|
||||
clan.inventory.instances.syncthing = {
|
||||
roles.peer.tags.syncthing = { };
|
||||
roles.peer.settings.folders = {
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
let
|
||||
user = "u422292";
|
||||
host = "${user}.your-storagebox.de";
|
||||
in
|
||||
{
|
||||
programs.ssh.knownHosts = {
|
||||
storagebox-ed25519 = {
|
||||
hostNames = [ "[${host}]:23" ];
|
||||
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue