hosts/*: pull filesystems into their own files

This commit is contained in:
Infinidoge 2023-07-25 18:08:31 -04:00
parent 135499148e
commit b54cca8634
9 changed files with 229 additions and 233 deletions

View file

@ -8,6 +8,7 @@
private.nixosModules.wireless
./hardware-configuration.nix
./filesystems.nix
];
system.stateVersion = "21.11";

View file

@ -0,0 +1,83 @@
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
esp = uuid "1DB7-2844";
main = uuid "13f97ece-823e-4785-b06e-6c284105d379";
backup = uuid "dabfc36b-20d1-4b09-8f55-4f9df7499741";
hydrus = uuid "2a025f29-4058-4a76-8f38-483f0925375d";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=28G" "mode=755" ];
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = commonOptions;
};
"/media/backup" = {
device = backup;
fsType = "btrfs";
options = commonOptions;
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/persist/srv" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root/srv" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=262" ] ++ commonOptions;
neededForBoot = true;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = esp;
fsType = "vfat";
neededForBoot = true;
};
"/home/infinidoge/Hydrus" = {
device = hydrus;
fsType = "btrfs";
options = [ "subvol=Hydrus" ] ++ commonOptions;
};
};
swapDevices = [
{ device = uuid "37916097-dbb9-4a74-b761-17043629642a"; }
];
}

View file

@ -1,95 +1,11 @@
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
in
{
imports = [ ];
boot.initrd.availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems =
let
main = uuid "13f97ece-823e-4785-b06e-6c284105d379";
backup = uuid "dabfc36b-20d1-4b09-8f55-4f9df7499741";
esp = uuid "1DB7-2844";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=28G" "mode=755" ];
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/persist/srv" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root/srv" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=262" ] ++ commonOptions;
neededForBoot = true;
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = commonOptions;
};
"/media/backup" = {
device = backup;
fsType = "btrfs";
options = commonOptions;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = esp;
fsType = "vfat";
neededForBoot = true;
};
"/home/infinidoge/Hydrus" = {
device = uuid "2a025f29-4058-4a76-8f38-483f0925375d";
fsType = "btrfs";
options = [ "subvol=Hydrus" ] ++ commonOptions;
};
};
swapDevices = [
{ device = uuid "37916097-dbb9-4a74-b761-17043629642a"; }
];
info = {
monitors = 3;
model = "Custom Desktop";

View file

@ -9,6 +9,7 @@
])
./hardware-configuration.nix
./filesystems.nix
];
system.stateVersion = "21.11";

View file

@ -0,0 +1,60 @@
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
main = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=8G" "mode=755" ];
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = commonOptions;
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=628" ] ++ commonOptions;
neededForBoot = true;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = uuid "3FC9-0182";
fsType = "vfat";
neededForBoot = true;
};
};
swapDevices = [
{ device = uuid "28672ffb-9f1c-462b-b49d-8a14b3dd72b3"; }
];
}

View file

@ -1,73 +1,11 @@
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems =
let
main = uuid "a44af0ff-5667-465d-b80a-1934d1aab8d9";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=8G" "mode=755" ];
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=628" ] ++ commonOptions;
neededForBoot = true;
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = commonOptions;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = uuid "3FC9-0182";
fsType = "vfat";
neededForBoot = true;
};
};
swapDevices = [{ device = uuid "28672ffb-9f1c-462b-b49d-8a14b3dd72b3"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
info.model = "Framework Laptop";

View file

@ -5,6 +5,7 @@
private.nixosModules.minecraft-servers
private.nixosModules.nitter
./hardware-configuration.nix
./filesystems.nix
];
system.stateVersion = "22.05";

View file

@ -0,0 +1,80 @@
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
main = uuid "5f24b2a6-643d-4abd-a3b2-61ee124700b5";
esp = uuid "A2B8-4C6E";
data = uuid "59abb0ff-fe4e-4061-87d2-b728b937656a";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
fileSystems = {
"/" = {
device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = [ "subvol=/" ] ++ commonOptions;
neededForBoot = true;
};
"/media/data" = lib.mkIf (data != null) {
device = data;
fsType = "btrfs";
options = [ "subvol=/" ] ++ commonOptions;
neededForBoot = true;
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=264" ] ++ commonOptions;
neededForBoot = true;
};
"/persist/srv" = lib.mkIf (data != null) {
device = data;
fsType = "btrfs";
options = [ "subvol=root/srv" ] ++ commonOptions;
neededForBoot = true;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = esp;
fsType = "vfat";
neededForBoot = true;
};
};
swapDevices = [
{ device = uuid "b064d69c-0310-4a94-a0de-a4b358f54f9e"; }
];
}

View file

@ -1,94 +1,10 @@
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, pkgs, ... }:
let
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
in
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "usb_storage" "xhci_pci" "ahci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "boot.shell_on_fail" ];
boot.supportedFilesystems = [ "btrfs" ];
fileSystems =
let
main = uuid "5f24b2a6-643d-4abd-a3b2-61ee124700b5";
esp = uuid "A2B8-4C6E";
data = uuid "59abb0ff-fe4e-4061-87d2-b728b937656a";
commonOptions = [ "autodefrag" "noatime" "ssd" ];
in
{
"/" = {
device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
"/media/main" = {
device = main;
fsType = "btrfs";
options = [ "subvol=/" ] ++ commonOptions;
neededForBoot = true;
};
"/media/data" = lib.mkIf (data != null) {
device = data;
fsType = "btrfs";
options = [ "subvol=/" ] ++ commonOptions;
neededForBoot = true;
};
"/persist" = {
device = main;
fsType = "btrfs";
options = [ "subvol=root" ] ++ commonOptions;
neededForBoot = true;
};
"/etc/ssh" = {
device = main;
fsType = "btrfs";
options = [ "subvolid=264" ] ++ commonOptions;
neededForBoot = true;
};
"/persist/srv" = lib.mkIf (data != null) {
device = data;
fsType = "btrfs";
options = [ "subvol=root/srv" ] ++ commonOptions;
neededForBoot = true;
};
"/nix" = {
device = main;
fsType = "btrfs";
options = [ "subvol=nix" ] ++ commonOptions;
neededForBoot = true;
};
"/boot" = {
device = main;
fsType = "btrfs";
options = [ "subvol=boot" ] ++ commonOptions;
neededForBoot = true;
};
"/boot/efi" = {
device = esp;
fsType = "vfat";
neededForBoot = true;
};
};
swapDevices = [
{ device = uuid "b064d69c-0310-4a94-a0de-a4b358f54f9e"; }
];
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}