tsuki: move all datafiles/drives to TrueNAS NFS

This commit is contained in:
Oystein Kristoffer Tveit 2023-01-03 22:59:30 +01:00
parent aea736c2df
commit 47f8183490
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
4 changed files with 25 additions and 19 deletions

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./extra-hardware-configuration.nix
# ./services/calibre.nix # ./services/calibre.nix
./services/gitea ./services/gitea
@ -23,14 +24,16 @@
machineVars = { machineVars = {
headless = true; headless = true;
dataDrives = let dataDrives = {
momiji = "/data2";
in {
drives = { drives = {
cirno = "/data"; backup = "/data2/backup";
inherit momiji; momiji = "/data2/momiji";
cirno = "/data2/cirno";
media = "/data2/media";
postgres = "/data2/postgres";
home = "/data2/home";
}; };
default = momiji; default = "/data2/momiji";
}; };
}; };

View File

@ -0,0 +1,13 @@
{ ... }: let
nfsDrive = drivename: {
device = "10.0.0.36:/mnt/PoolsClosed/${drivename}";
fsType = "nfs";
options = [ "nfsvers=3" ];
};
in {
fileSystems."/data2/backup" = nfsDrive "backup";
fileSystems."/data2/momiji" = nfsDrive "momiji";
fileSystems."/data2/media" = nfsDrive "media";
fileSystems."/data2/postgres" = nfsDrive "postgres";
fileSystems."/data2/home" = nfsDrive "home";
}

View File

@ -23,16 +23,6 @@
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/data" =
{ device = "/dev/disk/by-uuid/87354b26-4f7f-4b94-96fd-4bbeb834a03b";
fsType = "btrfs";
};
fileSystems."/data2" =
{ device = "/dev/disk/by-uuid/c481da40-08dd-4d6d-abeb-f1976cb4271a";
fsType = "btrfs";
};
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/92a1a33f-89a8-45de-a45e-6c303172cd7f"; } [ { device = "/dev/disk/by-uuid/92a1a33f-89a8-45de-a45e-6c303172cd7f"; }
]; ];

View File

@ -10,7 +10,7 @@
host all all ::1/128 trust host all all ::1/128 trust
''; '';
port = secrets.ports.postgres; port = secrets.ports.postgres;
dataDir = "${config.machineVars.dataDrives.default}/db/postgres/${config.services.postgresql.package.psqlSchema}"; dataDir = "${config.machineVars.dataDrives.drives.postgres}/${config.services.postgresql.package.psqlSchema}";
# settings = {}; # settings = {};
}; };
@ -18,7 +18,7 @@
enable = true; enable = true;
openFirewall = true; openFirewall = true;
initialEmail = "h7x4@nani.wtf"; initialEmail = "h7x4@nani.wtf";
initialPasswordFile = "${config.machineVars.dataDrives.default}/var/pgadmin_pass"; initialPasswordFile = "${config.machineVars.dataDrives.default}/keys/pgadmin_pass";
port = secrets.ports.pgadmin; port = secrets.ports.pgadmin;
settings = { settings = {
DATA_DIR = "${config.machineVars.dataDrives.default}/var/pgadmin"; DATA_DIR = "${config.machineVars.dataDrives.default}/var/pgadmin";
@ -27,7 +27,7 @@
services.postgresqlBackup = { services.postgresqlBackup = {
enable = true; enable = true;
location = "${config.machineVars.dataDrives.default}/backup/postgres"; location = "${config.machineVars.dataDrives.drives.backup}/postgres";
backupAll = true; backupAll = true;
}; };
} }