Archived
Stage a ZFS RAID0 disko layout for the bare-metal gui host
Adds modules/disko/baremetal.nix: two disks, each its own top-level zpool vdev with no mirror/raidz between them (disko's zpool `mode` defaults to "" for a plain stripe), ESP + systemd-boot on disk1. Device paths are placeholders in variables.nix (guiRootDisk1/guiRootDisk2) until the real hardware profile arrives. Verified structurally by building a throwaway nixosSystem with the actual disko.nixosModules.disko and reading the generated system.build.formatScript: it emits `zpool create rpool ... disk1 disk2` with no mirror/raidz keyword, confirming a genuine stripe. Not yet wired into any flake target -- that happens once the hardware config lands and a new bare-metal platform module is added, per the agreed sequencing.
This commit is contained in:
@@ -0,0 +1,87 @@
|
|||||||
|
{ vars, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# ZFS RAID0 (striped, no redundancy) root pool for the bare-metal gui
|
||||||
|
# host — two disks, each contributing its own top-level vdev. disko's
|
||||||
|
# zpool `mode` defaults to "" (plain stripe) when left unset, which is
|
||||||
|
# what gives RAID0 semantics here rather than mirror/raidz.
|
||||||
|
#
|
||||||
|
# Device paths are placeholders until the real hardware profile lands —
|
||||||
|
# fill in vars.guiRootDisk1/guiRootDisk2 (stable /dev/disk/by-id/...
|
||||||
|
# paths, not /dev/sdX) before running disko against real hardware. Swap
|
||||||
|
# is deliberately left out for now — sizing that sensibly needs the
|
||||||
|
# box's actual RAM size, which comes with the hardware profile too.
|
||||||
|
#
|
||||||
|
# Not yet imported anywhere: this awaits the new bare-metal platform
|
||||||
|
# module (alongside modules/boot/efi.nix for systemd-boot, matching
|
||||||
|
# modules/platforms/proxmox.nix's pattern) once the hardware config is
|
||||||
|
# in hand.
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
disk1 = {
|
||||||
|
type = "disk";
|
||||||
|
device = vars.guiRootDisk1;
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
|
||||||
|
partitions = {
|
||||||
|
esp = {
|
||||||
|
priority = 1;
|
||||||
|
name = "ESP";
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "rpool";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
disk2 = {
|
||||||
|
type = "disk";
|
||||||
|
device = vars.guiRootDisk2;
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
|
||||||
|
partitions = {
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "rpool";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
zpool.rpool = {
|
||||||
|
type = "zpool";
|
||||||
|
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "zstd";
|
||||||
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
};
|
||||||
|
mountpoint = "/";
|
||||||
|
options.ashift = "12";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -52,6 +52,12 @@
|
|||||||
wifiSsid = "";
|
wifiSsid = "";
|
||||||
wifiPassword = "";
|
wifiPassword = "";
|
||||||
|
|
||||||
|
# Bare-metal gui host's two disks for a ZFS RAID0 (striped) root pool
|
||||||
|
# (modules/disko/baremetal.nix). Use stable /dev/disk/by-id/... paths,
|
||||||
|
# not /dev/sdX -- fill in once the hardware profile is available.
|
||||||
|
guiRootDisk1 = "";
|
||||||
|
guiRootDisk2 = "";
|
||||||
|
|
||||||
# System
|
# System
|
||||||
timeZone = "Australia/Brisbane";
|
timeZone = "Australia/Brisbane";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user