tsuki: move all datafiles/drives to TrueNAS NFS
This commit is contained in:
parent
aea736c2df
commit
47f8183490
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
|
@ -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"; }
|
||||
];
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue