Radish alpha
r
rad:z254T5p17bdFPmzfDojsdjo4HjpoZ
Radicle Infrastructure as Code (NixOS, OpenTofu, …)
Radicle
Git
os/mixin/disk-config: Add disko mixin
Lorenz Leutgeb committed 10 months ago
commit f016c9046b8bc84562332844b8fd797e2572eb86
parent 6abea41
1 file changed +52 -0
added os/mixin/disk-config.nix
@@ -0,0 +1,52 @@
+
{lib, ...}: {
+
  disko.devices = {
+
    disk.main = {
+
      device = lib.mkDefault "/dev/sda";
+
      type = "disk";
+
      content = {
+
        type = "gpt";
+
        partitions = {
+
          boot = {
+
            name = "boot";
+
            size = "1M";
+
            type = "EF02";
+
          };
+
          esp = {
+
            name = "ESP";
+
            size = "512M";
+
            type = "EF00";
+
            content = {
+
              type = "filesystem";
+
              format = "vfat";
+
              mountpoint = "/boot";
+
            };
+
          };
+
          root = {
+
            name = "root";
+
            size = "100%";
+
            content = {
+
              type = "btrfs";
+
              extraArgs = ["-f"];
+
              subvolumes = let
+
                mountOptions = ["compress=zstd" "discard=async" "noatime"];
+
              in {
+
                "/" = {
+
                  inherit mountOptions;
+
                  mountpoint = "/";
+
                };
+
                "/home" = {
+
                  inherit mountOptions;
+
                  mountpoint = "/home";
+
                };
+
                "/nix" = {
+
                  inherit mountOptions;
+
                  mountpoint = "/nix";
+
                };
+
              };
+
            };
+
          };
+
        };
+
      };
+
    };
+
  };
+
}