From 2c4fdfd22245623568b7b01780ea85c88bb8be9e Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Sun, 5 May 2024 10:16:30 -0400 Subject: [PATCH] Infini-DL360: refactor disks again --- hosts/Infini-DL360/default.nix | 1 - hosts/Infini-DL360/disks.nix | 36 ++++++++++++---------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/hosts/Infini-DL360/default.nix b/hosts/Infini-DL360/default.nix index cc5b350..b836042 100644 --- a/hosts/Infini-DL360/default.nix +++ b/hosts/Infini-DL360/default.nix @@ -11,7 +11,6 @@ modules = { boot.grub.enable = true; - boot.grub.efiSysMountPoint = "/boot"; boot.timeout = 5; hardware.form.server = true; }; diff --git a/hosts/Infini-DL360/disks.nix b/hosts/Infini-DL360/disks.nix index d98ca95..a221668 100644 --- a/hosts/Infini-DL360/disks.nix +++ b/hosts/Infini-DL360/disks.nix @@ -2,38 +2,24 @@ with lib.our.disko; let inherit (builtins) mapAttrs; + inherit (lib) genAttrs flip; mountOptions = defaultMountOptions; in { boot.kernelPackages = lib.mkForce config.boot.zfs.package.latestCompatibleLinuxPackages; - persist.directories = [ "/etc/ssh" ]; - disko.devices = { - nodev."/" = { - fsType = "tmpfs"; - mountOptions = mountOptions ++ [ - "size=64G" - "mode=755" - ]; - }; + nodev."/" = mkTmpfs "64G"; disk = { lun = mkDisk "usb-HP_iLO_LUN_01_Media_0_000002660A01-0:1" { partitions = { - boot = { - size = "256M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - inherit mountOptions; + boot = mkESP "64M" "/boot/efi"; + store = mkBtrfsPart "100%" "/media/store" { + subvolumes = mkBtrfsSubvols { + "/boot" = { }; + "/etc/ssh" = { }; }; }; - # Keystore partition? - #keystore = { - # size = "100%"; - #}; }; }; ssd1 = mkZDisk "wwn-0x50026b728203a6fb" "zssd"; @@ -60,7 +46,9 @@ in }; }; - fileSystems."/persist".neededForBoot = true; - fileSystems."/storage".neededForBoot = true; - fileSystems."/etc/ssh".neededForBoot = true; + fileSystems = flip genAttrs (_: { neededForBoot = true; }) [ + "/persist" + "/storage" + "/etc/ssh" + ]; }