Add second backup node

This commit is contained in:
asonix 2023-08-09 15:02:51 -05:00
parent 55dbd1ab39
commit 93c41bc533
2 changed files with 134 additions and 15 deletions

View file

@ -58,11 +58,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1690367991,
"narHash": "sha256-2VwOn1l8y6+cu7zjNE8MgeGJNNz1eat1HwHrINeogFA=",
"lastModified": 1691472822,
"narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c9cf0708f00fbe553319258e48ca89ff9a413703",
"rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff",
"type": "github"
},
"original": {
@ -90,11 +90,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1690470004,
"narHash": "sha256-l57RmPhPz9r1LGDg/0v8bYgJO8R+GGTQZtkIxE7negU=",
"lastModified": 1691421349,
"narHash": "sha256-RRJyX0CUrs4uW4gMhd/X4rcDG8PTgaaCQM5rXEJOx6g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9462344318b376e157c94fa60c20a25b913b2381",
"rev": "011567f35433879aae5024fc6ec53f2a0568a6c4",
"type": "github"
},
"original": {
@ -120,11 +120,11 @@
]
},
"locked": {
"lastModified": 1690231180,
"narHash": "sha256-b3YyZItwK4stfBCOwL/9gAH2ufEV7TWZB29rRb31Tr8=",
"lastModified": 1690572361,
"narHash": "sha256-pg0mdTG0d0tTQJQ3njn3k1uKMh7Ds3p3weWzdMfLibg=",
"owner": "asonix",
"repo": "nixos-rockchip",
"rev": "4bedf57363a3cefb65fbc4676dd0856ccb7fa824",
"rev": "fdb07644a57e00de295e815efc868d5cb402d4b5",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
"rockchip": "rockchip"
},
"locked": {
"lastModified": 1690576513,
"narHash": "sha256-kkBSv6BE5tG8WMSjIANaQoIU6fsdhgKx8UX+jg56PPA=",
"lastModified": 1691609547,
"narHash": "sha256-7H1h6qroH89IjvVZNZu1IlzO8ZqvPlT5O9Mr0UnjnRI=",
"ref": "asonix/nabam-sd-image",
"rev": "749bc2e8190f7d4cbb14d511cf1971de4c9fd652",
"revCount": 58,
"rev": "97bf2cb84ef32fc218d1efecfd5e2a12626971c9",
"revCount": 59,
"type": "git",
"url": "https://git.asonix.dog/asonix/sd-images"
},

123
flake.nix
View file

@ -804,14 +804,14 @@
inherit name;
primaryIp = ip;
mountDir = "/btrfs/nvme2";
subvolumes = [ "@exports" "@garage" ];
subvolumes = [ "@garage" ];
};
k3s = { ip, name }: {
inherit name;
primaryIp = ip;
mountDir = "/btrfs/nvme";
subvolumes = [ "@exports" "@garage" ];
subvolumes = [ "@garage" ];
};
db = { ip, name }: {
@ -850,11 +850,126 @@
ip = "192.168.20.124";
name = "k3s5";
}
]) ++ (builtins.map k3s [
{
ip = "192.168.20.125";
name = "k3s6";
}
{
ip = "192.168.20.126";
name = "k3s7";
}
{
ip = "192.168.20.127";
name = "k3s8";
}
{
ip = "192.168.20.128";
name = "k3s9";
}
{
ip = "192.168.20.129";
name = "k3s10";
}
{
ip = "192.168.20.130";
name = "k3s11";
}
{
ip = "192.168.20.131";
name = "k3s12";
}
]) ++ (builtins.map db [
{
ip = "192.168.20.11";
name = "whitestorm1";
}
{
ip = "192.168.20.23";
name = "redtail1";
}
]);
};
backup2 =
let
k3sOld = { ip, name }: {
inherit name;
primaryIp = ip;
mountDir = "/btrfs/nvme2";
subvolumes = [ "@exports" ];
};
k3s = { ip, name }: {
inherit name;
primaryIp = ip;
mountDir = "/btrfs/nvme";
subvolumes = [ "@exports" ];
};
db = { ip, name }: {
inherit name;
primaryIp = ip;
mountDir = "/btrfs/ssd";
subvolumes = [ "@postgres" "@postgres-cfg" ];
};
firestar = { name, subvolumes }: {
name = "firestar-${name}";
primaryIp = "192.168.50.10";
mountDir = "/btrfs/${name}";
inherit subvolumes;
};
in
makeRockPro64BackupConfig system {
hostname = "backup2";
selfIp = "192.168.20.191";
unlockMounts = false;
mountVolumes = false;
enableBackups = false;
backupHosts = (builtins.map firestar [
{
name = "hdd";
subvolumes = [ "@diskimages" "@documents" "@downloads" "@music" "@pictures" "@videos" ];
}
{
name = "ssd";
subvolumes = [ "@games" ];
}
{
name = "nvme";
subvolumes = [ "@development" ];
}
{
name = "nvme2";
subvolumes = [ "@games" ];
}
]) ++ (builtins.map k3sOld [
{
ip = "192.168.20.120";
name = "k3s1";
}
{
ip = "192.168.20.121";
name = "k3s2";
}
{
ip = "192.168.20.122";
name = "k3s3";
}
{
ip = "192.168.20.123";
name = "k3s4";
}
{
ip = "192.168.20.124";
name = "k3s5";
}
]) ++ (builtins.map k3s [
{
ip = "192.168.20.125";
name = "k3s6";
}
{
ip = "192.168.20.126";
name = "k3s7";
@ -999,6 +1114,10 @@
name = "backup1";
ip = "192.168.20.190";
}
{
name = "backup2";
ip = "192.168.20.191";
}
{
name = "pinetab2";
ip = "192.168.5.13";