From 4168dffb05407ec004efc430cdae036958627e48 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 31 Jul 2025 14:35:53 -0500 Subject: [PATCH] try adding disk --- .../configuration/homebox/default.nix | 2 +- system-config/configuration/homebox/disko.nix | 242 ++++++++++-------- 2 files changed, 140 insertions(+), 104 deletions(-) diff --git a/system-config/configuration/homebox/default.nix b/system-config/configuration/homebox/default.nix index ffbe917..13565b2 100644 --- a/system-config/configuration/homebox/default.nix +++ b/system-config/configuration/homebox/default.nix @@ -7,7 +7,7 @@ inputs.disko.nixosModules.default - (import ./disko.nix { device1 = "/dev/nvme0n1"; device2 = "/dev/nvme1n1"; }) + (import ./disko.nix { device1 = "/dev/nvme0n1"; device2 = "/dev/nvme1n1"; device3 = "/dev/sda"; }) inputs.impermanence.nixosModules.impermanence diff --git a/system-config/configuration/homebox/disko.nix b/system-config/configuration/homebox/disko.nix index d095d73..c2ddbaa 100644 --- a/system-config/configuration/homebox/disko.nix +++ b/system-config/configuration/homebox/disko.nix @@ -1,114 +1,150 @@ { device1 ? throw "Set this to your disk device, e.g. /dev/sda", device2, + device3, ... }: { disko.devices = { - disk = { - main = { - device = device1; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - swap = { - size = "4G"; - content = { - type = "swap"; - resumeDevice = true; - }; - }; - root = { - name = "root"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "root_vg"; - }; - }; - }; - }; - }; - ssd1 = { - device = device2; - type = "disk"; - content = { - type = "gpt"; - partitions = { - ssd1 = { - name = "ssd1"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "ssd1_vg"; - }; - }; - }; - }; - }; - }; - lvm_vg = { - root_vg = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%FREE"; - content = { - type = "btrfs"; - extraArgs = ["-f"]; - - subvolumes = { - "/root" = { - mountpoint = "/"; - }; - - "/persist" = { - mountOptions = ["subvol=persist" "noatime"]; - mountpoint = "/persist"; - }; - - "/nix" = { - mountOptions = ["subvol=nix" "noatime"]; - mountpoint = "/nix"; - }; + disk = { + main = { + device = device1; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + swap = { + size = "4G"; + content = { + type = "swap"; + resumeDevice = true; + }; + }; + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "root_vg"; + }; + }; + }; + }; + }; + ssd1 = { + device = device2; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ssd1 = { + name = "ssd1"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "ssd1_vg"; + }; + }; + }; + }; + }; + hdd1 = { + device = device3; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ssd1 = { + name = "hdd1"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "hdd1_vg"; + }; + }; + }; }; - }; }; - }; }; - ssd1_vg = { - type = "lvm_vg"; - lvs = { - ssd1 = { - size = "100%FREE"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/ssd1" = { - mountOptions = [ "subvol=ssd1" "noatime" ]; - mountpoint = "/ssd1"; - }; - }; - }; - }; - }; - }; - }; + lvm_vg = { + root_vg = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "btrfs"; + extraArgs = ["-f"]; + + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + + "/persist" = { + mountOptions = ["subvol=persist" "noatime"]; + mountpoint = "/persist"; + }; + + "/nix" = { + mountOptions = ["subvol=nix" "noatime"]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + ssd1_vg = { + type = "lvm_vg"; + lvs = { + ssd1 = { + size = "100%FREE"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/ssd1" = { + mountOptions = [ "subvol=ssd1" "noatime" ]; + mountpoint = "/ssd1"; + }; + }; + }; + }; + }; + }; + hdd1_vg = { + type = "lvm_vg"; + lvs = { + ssd1 = { + size = "100%FREE"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/hdd1" = { + mountOptions = [ "subvol=hdd1" "noatime" ]; + mountpoint = "/hdd1"; + }; + }; + }; + }; + }; + }; + }; }; }