restructured directories + modularized btrfs mount
This commit is contained in:
155
hosts/miniserver/fstab.nix
Normal file
155
hosts/miniserver/fstab.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }: {
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
boot = {
|
||||
loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "nodev";
|
||||
efiSupport = true;
|
||||
enableCryptodisk = true;
|
||||
};
|
||||
};
|
||||
initrd.luks.devices = {
|
||||
nvme = {
|
||||
device = "/dev/disk/by-uuid/30fd7d86-9bed-42a6-8a4e-a2ddb0031233";
|
||||
preLVM = true;
|
||||
};
|
||||
# disk1 = {
|
||||
# device = "/dev/disk/by-uuid/a9b0f346-7e38-40a6-baf6-3ad80cafc842";
|
||||
# preLVM = true;
|
||||
# };
|
||||
# disk2 = {
|
||||
# device = "/dev/disk/by-uuid/0ed12b83-4c56-4ba8-b4ea-75a9e927d771";
|
||||
# preLVM = true;
|
||||
# };
|
||||
# disk3 = {
|
||||
# device = "/dev/disk/by-uuid/8cd728f6-0d5b-4cea-8f7d-01aad11192c1";
|
||||
# preLVM = true;
|
||||
# };
|
||||
# disk4 = {
|
||||
# device = "/dev/disk/by-uuid/7fcac808-491f-4846-a4a9-a34cc77cb43d";
|
||||
# preLVM = true;
|
||||
# };
|
||||
};
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
kernel.sysctl = {
|
||||
"vm.swappiness" = 80;
|
||||
"net.ipv6.conf.all.disable_ipv6" = 1;
|
||||
"net.ipv6.conf.lo.disable_ipv6" = 1;
|
||||
"net.ipv6.conf.default.disable_ipv6" = 1;
|
||||
};
|
||||
extraModulePackages = [ ];
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/mapper/nvme";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=nix"
|
||||
"ssd"
|
||||
"compress=zstd:3"
|
||||
"x-systemd.device-timeout=0"
|
||||
"space_cache=v2"
|
||||
"commit=120"
|
||||
"datacow"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"/home" = {
|
||||
device = "/dev/mapper/nvme";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=home"
|
||||
"ssd"
|
||||
"compress=zstd:3"
|
||||
"x-systemd.device-timeout=0"
|
||||
"space_cache=v2"
|
||||
"commit=120"
|
||||
"datacow"
|
||||
];
|
||||
};
|
||||
# "/mnt/pool" = {
|
||||
# device = "/dev/disk/by-uuid/1e7cf787-e34d-4e3e-ac3c-0c07309dbd34";
|
||||
# fsType = "btrfs";
|
||||
# options = [
|
||||
# "subvol=@data"
|
||||
# "compress=zstd:3"
|
||||
# "space_cache=v2"
|
||||
# "commit=120"
|
||||
# "datacow"
|
||||
# ];
|
||||
# };
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/bf0aeb95-94cc-4377-b6e4-1dbb4958b334";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/0C7B-4D4C";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/var/lib/nextcloud/data" = {
|
||||
device = "/mnt/pool/nextcloud";
|
||||
options = [ "bind" ];
|
||||
depends = [ "/mnt/pool" ];
|
||||
};
|
||||
# "/mnt/jellyfin/media" = {
|
||||
# device = "/mnt/pool/multimedia/media";
|
||||
# options = [ "bind" "ro" ];
|
||||
# depends = [ "/mnt/pool" ];
|
||||
# };
|
||||
# NFS
|
||||
"/export/pool" = {
|
||||
device = "/mnt/pool";
|
||||
options = [ "bind" ];
|
||||
depends = [ "/mnt/pool" ];
|
||||
};
|
||||
"/export/jawz" = {
|
||||
device = "/home/jawz";
|
||||
options = [ "bind" ];
|
||||
depends = [ "/mnt/pool" ];
|
||||
};
|
||||
"/export/disks" = {
|
||||
device = "/mnt/disks";
|
||||
options = [ "bind" ];
|
||||
depends = [ "/mnt/disks" ];
|
||||
};
|
||||
};
|
||||
services.nfs = {
|
||||
server = {
|
||||
enable = true;
|
||||
exports = ''
|
||||
/export workstation(rw,fsid=0,no_subtree_check)
|
||||
/export/jawz workstation(rw,nohide,insecure,no_subtree_check)
|
||||
/export/disks workstation(rw,nohide,insecure,no_subtree_check)
|
||||
/export/pool workstation(rw,nohide,insecure,no_subtree_check)
|
||||
'';
|
||||
};
|
||||
};
|
||||
swapDevices = [{
|
||||
device = "/dev/nvme0n1p3";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}];
|
||||
}
|
||||
Reference in New Issue
Block a user