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 = [
./hardware-configuration.nix
./extra-hardware-configuration.nix
# ./services/calibre.nix
./services/gitea
@ -23,14 +24,16 @@
machineVars = {
headless = true;
dataDrives = let
momiji = "/data2";
in {
dataDrives = {
drives = {
cirno = "/data";
inherit momiji;
backup = "/data2/backup";
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";
};
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 =
[ { device = "/dev/disk/by-uuid/92a1a33f-89a8-45de-a45e-6c303172cd7f"; }
];

View File

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