diff --git a/nixos/hosts/framework-server/disks.nix b/nixos/hosts/framework-server/disks.nix index 2baf2cff..13da5392 100644 --- a/nixos/hosts/framework-server/disks.nix +++ b/nixos/hosts/framework-server/disks.nix @@ -12,26 +12,26 @@ services.btrfs.autoScrub.interval = "weekly"; disko.devices.disk.nvme0 = { + type = "disk"; device = "/dev/nvme0n1"; content = { - type = "table"; format = "gpt"; - partitions = [ - { + partitions = { + BOOT = { + priority = 1; name = "BOOT"; start = "0%"; end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; + type = "EF00"; content = { type = "filesystem"; format = "vfat"; + # https://github.com/nix-community/disko/issues/527 + mountOptions = [ "umask=0077" ]; mountpoint = "/boot"; }; - } # partition 1 (ESP) - { - name = "LUKS"; + }; # partition 1 (ESP) + LUKS-ROOT = { start = "550MiB"; end = "100%"; content = { @@ -78,8 +78,8 @@ }; # subvolumes }; # content.content }; # content - } # partition 2 (/ BTRFS) - ]; # partitions + }; # partition 2 (/ BTRFS) + }; # partitions }; # content }; # disko.devices.disk.nvme0 } # root diff --git a/nixos/hosts/nixos-desktop/disks.nix b/nixos/hosts/nixos-desktop/disks.nix index af36f58c..48816c5d 100644 --- a/nixos/hosts/nixos-desktop/disks.nix +++ b/nixos/hosts/nixos-desktop/disks.nix @@ -1,30 +1,30 @@ { imports = [ ../../common/services/snapper.nix ]; - + services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; disko.devices.disk.nvme0 = { + type = "disk"; device = "/dev/nvme0n1"; - content = { - type = "table"; + content = { format = "gpt"; - partitions = [ - { + partitions = { + BOOT = { + priority = 1; name = "BOOT"; start = "0%"; end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; + type = "EF00"; content = { type = "filesystem"; format = "vfat"; + # https://github.com/nix-community/disko/issues/527 + mountOptions = [ "umask=0077" ]; mountpoint = "/boot"; }; - } # partition 1 (ESP) - { - name = "LUKS"; + }; # partition 1 (ESP) + LUKS-ROOT = { start = "550MiB"; end = "100%"; content = { @@ -47,10 +47,6 @@ mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ]; }; # nix - "/games" = { - mountpoint = "/games"; - mountOptions = [ "noatime" ]; - }; # games # SNAPSHOT SUBVOLS "/root/.snapshots" = { mountpoint = "/.snapshots"; @@ -67,8 +63,8 @@ }; # subvolumes }; # content.content }; # content - } # partition 2 (/ BTRFS) - ]; # partitions + }; # partition 2 (/ BTRFS) + }; # partitions }; # content }; # disko.devices.disk.nvme0 } # root diff --git a/nixos/hosts/nixos-framework/default.nix b/nixos/hosts/nixos-framework/default.nix index 0e85487f..adda4f94 100644 --- a/nixos/hosts/nixos-framework/default.nix +++ b/nixos/hosts/nixos-framework/default.nix @@ -2,7 +2,7 @@ imports = [ inputs.nixos-hardware.nixosModules.framework-13-7040-amd (modulesPath + "/installer/scan/not-detected.nix") - ./disks-gpt.nix + ./disks.nix ./syncthing.nix ../../common/services/tailscale-autoconnect.nix # ../../common/modules/secureboot.nix diff --git a/nixos/hosts/nixos-framework/disks-gpt.nix b/nixos/hosts/nixos-framework/disks-gpt.nix deleted file mode 100644 index 273bd6ef..00000000 --- a/nixos/hosts/nixos-framework/disks-gpt.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - imports = [ ../../common/services/snapper.nix ]; - - services.btrfs.autoScrub.enable = true; - services.btrfs.autoScrub.interval = "weekly"; - - boot.resumeDevice = "/dev/mapper/ROOT"; - # https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/ - boot.kernelParams = [ "resume_offset=533760" ]; - - disko.devices.disk.nvme0n1 = { - type = "disk"; - device = "/dev/nvme0n1"; - content = { - type = "gpt"; - partitions = { - BOOT = { - priority = 1; - name = "BOOT"; - start = "0%"; - end = "550MiB"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - # https://github.com/nix-community/disko/issues/527 - mountOptions = [ "umask=0077" ]; - mountpoint = "/boot"; - }; - }; # partition 1 (ESP) - LUKS-ROOT = { - start = "550MiB"; - end = "100%"; - content = { - type = "luks"; - name = "ROOT"; - extraOpenArgs = [ "--allow-discards" ]; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/root" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # root - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # home - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # nix - # SNAPSHOT SUBVOLS - "/root/.snapshots" = { - mountpoint = "/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # root - "/home/.snapshots" = { - mountpoint = "/home/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # home - "/nix/.snapshots" = { - mountpoint = "/nix/.snapshots"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; # nix - # Swap partition - "/swap" = { - mountpoint = "/swap"; - swap.swapfile.size = "64G"; - }; # swap - }; # subvolumes - }; # content.content - }; # content - }; # partition 2 (/ BTRFS) - }; # partitions - }; # content - }; # disko.devices.disk.nvme0 -} # nix diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix index 7a506cc5..273bd6ef 100644 --- a/nixos/hosts/nixos-framework/disks.nix +++ b/nixos/hosts/nixos-framework/disks.nix @@ -1,28 +1,25 @@ { - - imports = [ ../../common/services/snapper.nix ]; services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; boot.resumeDevice = "/dev/mapper/ROOT"; - boot.kernelParams = [ "resume_offset=533760" ]; # https://sawyershepherd.org/post/hibernating-to-an-encrypted-swapfile-on-btrfs-with-nixos/ + boot.kernelParams = [ "resume_offset=533760" ]; - disko.devices.disk.nvme0 = { + disko.devices.disk.nvme0n1 = { + type = "disk"; device = "/dev/nvme0n1"; content = { - type = "table"; - format = "gpt"; - partitions = [ - { + type = "gpt"; + partitions = { + BOOT = { + priority = 1; name = "BOOT"; start = "0%"; end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; + type = "EF00"; content = { type = "filesystem"; format = "vfat"; @@ -30,11 +27,10 @@ mountOptions = [ "umask=0077" ]; mountpoint = "/boot"; }; - } # partition 1 (ESP) - { - name = "LUKS-ROOT"; + }; # partition 1 (ESP) + LUKS-ROOT = { start = "550MiB"; - end = "-64GiB"; + end = "100%"; content = { type = "luks"; name = "ROOT"; @@ -76,8 +72,8 @@ }; # subvolumes }; # content.content }; # content - } # partition 2 (/ BTRFS) - ]; # partitions + }; # partition 2 (/ BTRFS) + }; # partitions }; # content }; # disko.devices.disk.nvme0 } # nix diff --git a/nixos/hosts/nuc-server/disks.nix b/nixos/hosts/nuc-server/disks.nix index 609f6371..48816c5d 100644 --- a/nixos/hosts/nuc-server/disks.nix +++ b/nixos/hosts/nuc-server/disks.nix @@ -1,30 +1,30 @@ { imports = [ ../../common/services/snapper.nix ]; - + services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.interval = "weekly"; disko.devices.disk.nvme0 = { + type = "disk"; device = "/dev/nvme0n1"; content = { - type = "table"; format = "gpt"; - partitions = [ - { + partitions = { + BOOT = { + priority = 1; name = "BOOT"; start = "0%"; end = "550MiB"; - bootable = true; - flags = [ "esp" ]; - fs-type = "fat32"; + type = "EF00"; content = { type = "filesystem"; format = "vfat"; + # https://github.com/nix-community/disko/issues/527 + mountOptions = [ "umask=0077" ]; mountpoint = "/boot"; }; - } # partition 1 (ESP) - { - name = "LUKS"; + }; # partition 1 (ESP) + LUKS-ROOT = { start = "550MiB"; end = "100%"; content = { @@ -63,8 +63,8 @@ }; # subvolumes }; # content.content }; # content - } # partition 2 (/ BTRFS) - ]; # partitions + }; # partition 2 (/ BTRFS) + }; # partitions }; # content }; # disko.devices.disk.nvme0 } # root