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 = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
../shared/fs-layouts/single-disk-btrfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
@@ -22,40 +23,14 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems."/mnt/fileshare" = {
|
||||||
"/" = {
|
|
||||||
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" = {
|
|
||||||
device = "frank@vergil.cfl.rr.com:/mnt/shares";
|
device = "frank@vergil.cfl.rr.com:/mnt/shares";
|
||||||
fsType = "sshfs";
|
fsType = "sshfs";
|
||||||
|
|
||||||
options = [
|
options = [
|
||||||
"uid=1000"
|
"uid=1000"
|
||||||
"gid=1000"
|
"gid=1000"
|
||||||
@@ -65,14 +40,9 @@
|
|||||||
"x-systemd.automount"
|
"x-systemd.automount"
|
||||||
"reconnect"
|
"reconnect"
|
||||||
"ServerAliveInterval=15"
|
"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";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
../shared/fs-layouts/single-disk-btrfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
@@ -24,43 +25,11 @@
|
|||||||
|
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [ ];
|
||||||
|
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ ];
|
||||||
|
|
||||||
extraModulePackages = [ ];
|
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";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
hardware = {
|
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 = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
../shared/fs-layouts/single-disk-xfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
@@ -25,36 +26,26 @@
|
|||||||
kernelModules = [ ];
|
kernelModules = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = [ ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
# DO NOT mount by partlabel or other value other than UUID.
|
||||||
"/" = {
|
# Disk is a child of a VM disk from PROXMOX and WILL NOT
|
||||||
device = "/dev/disk/by-uuid/05376a0d-18d1-4e7b-8f75-fe052a5636ac";
|
# be picked up automatically elsewise.
|
||||||
fsType = "xfs";
|
fileSystems."/mnt" = {
|
||||||
};
|
|
||||||
|
|
||||||
"/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/631D-23D2";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [
|
|
||||||
"fmask=0077"
|
|
||||||
"dmask=0077"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/mnt" = {
|
|
||||||
device = "/dev/disk/by-uuid/1432aeae-71e9-4f34-97dc-cf0fe74a4e00";
|
device = "/dev/disk/by-uuid/1432aeae-71e9-4f34-97dc-cf0fe74a4e00";
|
||||||
fsType = "xfs";
|
fsType = "xfs";
|
||||||
|
|
||||||
options = [
|
options = [
|
||||||
"noauto"
|
"noauto"
|
||||||
"x-systemd.automount"
|
"x-systemd.automount"
|
||||||
"x-systemd.after=mount-vm-disk.service"
|
"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 = [ ];
|
swapDevices = [ ];
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|||||||
Reference in New Issue
Block a user