diff --git a/flake.nix b/flake.nix index d080654..a4bbe6d 100755 --- a/flake.nix +++ b/flake.nix @@ -469,7 +469,7 @@ system = "aarch64-linux"; modules = [ pi4-disko.nixosModules.disko - ./share/disko/disko.nix + ./share/disko/pi-uefi-disko.nix pi4-impermanence.nixosModules.impermanence pi4-sops-nix.nixosModules.sops diff --git a/share/disko/pi-uefi-disko.nix b/share/disko/pi-uefi-disko.nix new file mode 100644 index 0000000..f8a3b3b --- /dev/null +++ b/share/disko/pi-uefi-disko.nix @@ -0,0 +1,101 @@ +{ ... }: +let + rootDisk = "/dev/nvme0n1"; +in +{ + disko.devices.disk.main.imageSize = "32G"; + disko.devices = { + nodev."/" = { + fsType = "tmpfs"; + mountOptions = [ + "mode=755" + "defaults" + "size=2G" + ]; + }; + # root disk setup + disk.main = { + type = "disk"; + device = rootDisk; + content = { + type = "gpt"; + # specify partitions + partitions = { + # /boot/firmware + FIRMWARE = { + priority = 1; + name = "FIRMWARE"; + start = "1M"; + end = "1G"; + type = "0700"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/firmware"; + mountOptions = [ "umask=0077" ]; + }; + }; + # /boot + ESP = { + priority = 1; + name = "ESP"; + start = "1G"; + end = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + + root = { + name = "btrfs-root"; + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + "home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + "root" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/root"; + }; + "nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + "etc" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/etc"; + }; + "log" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/var/log"; + }; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file