refactor: switch from using UUIDs for filesystems to partlabels. Requires partition modifications on hosts before rebuild
This commit is contained in:
+5
-35
@@ -9,6 +9,7 @@
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
../shared/fs-layouts/single-disk-btrfs.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
@@ -22,40 +23,14 @@
|
||||
];
|
||||
|
||||
initrd.kernelModules = [ ];
|
||||
kernelModules = [ "kvm-amd" ];
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/7559f03a-28da-482d-934a-5d4f88ab085f";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
"/home" = {
|
||||
device = "/dev/disk/by-uuid/7559f03a-28da-482d-934a-5d4f88ab085f";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
device = "/dev/disk/by-uuid/7559f03a-28da-482d-934a-5d4f88ab085f";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/12B3-D345";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
"/mnt/fileshare" = {
|
||||
fileSystems."/mnt/fileshare" = {
|
||||
device = "frank@vergil.cfl.rr.com:/mnt/shares";
|
||||
fsType = "sshfs";
|
||||
|
||||
options = [
|
||||
"uid=1000"
|
||||
"gid=1000"
|
||||
@@ -65,14 +40,9 @@
|
||||
"x-systemd.automount"
|
||||
"reconnect"
|
||||
"ServerAliveInterval=15"
|
||||
"IdentityFile=/root/.ssh/id_rsa"
|
||||
"IdentityFile=${config.sops.secrets.personal_ssh_key_ed25519.path}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/431e8332-e3d5-400b-93e7-27b9c8dc1dfe"; }
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
../shared/fs-layouts/single-disk-btrfs.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
@@ -24,43 +25,11 @@
|
||||
|
||||
initrd.kernelModules = [ ];
|
||||
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
kernelModules = [ ];
|
||||
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/2b88fa45-f012-4df6-b59c-5b45ee0fc6e8";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
"/home" = {
|
||||
device = "/dev/disk/by-uuid/2b88fa45-f012-4df6-b59c-5b45ee0fc6e8";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
device = "/dev/disk/by-uuid/2b88fa45-f012-4df6-b59c-5b45ee0fc6e8";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/679B-3FC0";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/2ef72da1-8c5b-449d-8460-0f5833bd856d"; }
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
hardware = {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{ _, ... }:
|
||||
{
|
||||
# RECOMMENDED BTRFS SUBVOLUME LAYOUT
|
||||
# /home
|
||||
# /home/.snapshots (needed if snapper on home dir to be enabled)
|
||||
# /srv
|
||||
# /var/lib/portables
|
||||
# /var/lib/machines
|
||||
# /tmp
|
||||
# /var/tmp
|
||||
#
|
||||
# REQUIRED PARTLABELS (can be set in parted or other tools NOT!!! FILESYSTEM LABEL!)
|
||||
# / - NIXOS
|
||||
# /boot - ESP
|
||||
# swap - SWAP
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-partlabel/NIXOS";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-partlabel/ESP";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-partlabel/SWAP"; }
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{ _, ... }:
|
||||
{
|
||||
# REQUIRED PARTLABELS (can be set in parted or other tools NOT!!! FILESYSTEM LABEL!)
|
||||
# / - NIXOS
|
||||
# /boot - ESP
|
||||
# swap - SWAP
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-partlabel/NIXOS";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-partlabel/ESP";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-partlabel/SWAP"; }
|
||||
];
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
../shared/fs-layouts/single-disk-xfs.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
@@ -25,36 +26,26 @@
|
||||
kernelModules = [ ];
|
||||
};
|
||||
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/05376a0d-18d1-4e7b-8f75-fe052a5636ac";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/631D-23D2";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
"/mnt" = {
|
||||
# DO NOT mount by partlabel or other value other than UUID.
|
||||
# Disk is a child of a VM disk from PROXMOX and WILL NOT
|
||||
# be picked up automatically elsewise.
|
||||
fileSystems."/mnt" = {
|
||||
device = "/dev/disk/by-uuid/1432aeae-71e9-4f34-97dc-cf0fe74a4e00";
|
||||
fsType = "xfs";
|
||||
|
||||
options = [
|
||||
"noauto"
|
||||
"x-systemd.automount"
|
||||
"x-systemd.after=mount-vm-disk.service"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Vergil doesn't have a swap device but ../shared/fs-layouts/single-disk-xfs.nix defines one.
|
||||
# This shouldn't be an issue at runtime but explicit removal reduces log spam.
|
||||
swapDevices = [ ];
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
Reference in New Issue
Block a user