From 2cbacf93b6df435d341ce10027d99f76a3ef0e3a Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sat, 23 Aug 2025 21:39:28 +0100 Subject: [PATCH] hosts/helios: add initial disko config --- hosts/helios/default.nix | 3 + hosts/helios/disko-config.nix | 101 ++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 hosts/helios/disko-config.nix diff --git a/hosts/helios/default.nix b/hosts/helios/default.nix index c3a84f4..098c781 100644 --- a/hosts/helios/default.nix +++ b/hosts/helios/default.nix @@ -1,4 +1,5 @@ { + inputs, pkgs, lib, ... @@ -9,7 +10,9 @@ let in { imports = [ + inputs.disko.nixosModules.disko ./hardware-configuration.nix + ./disko-config.nix ../desktop.nix ../../users/jordan ]; diff --git a/hosts/helios/disko-config.nix b/hosts/helios/disko-config.nix new file mode 100644 index 0000000..421268d --- /dev/null +++ b/hosts/helios/disko-config.nix @@ -0,0 +1,101 @@ +{ ... }: +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-id/ata-SanDisk_Ultra_II_480GB_162224802391"; + content = { + type = "gpt"; + partitions = { + MBR = { + size = "1M"; + type = "EF02"; # For GRUB MBR + }; + boot = { + size = "500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "rpool"; + }; + }; + }; + }; + }; + }; + zpool = { + rpool = { + type = "zpool"; + options = { + ashift = "12"; + }; + rootFsOptions = { + compression = "zstd"; + acltype = "posix"; + atime = "off"; + xattr = "sa"; + dnodesize = "auto"; + mountpoint = "none"; + canmount = "off"; + devices = "off"; + exec = "off"; + setuid = "off"; + }; + datasets = { + "local" = { + type = "zfs_fs"; + }; + "local/root" = { + type = "zfs_fs"; + mountpoint = "/"; + options = { + canmount = "noauto"; + mountpoint = "/"; + exec = "on"; + setuid = "on"; + }; + postCreateHook = "zfs snapshot rpool/local/root@blank"; + }; + "local/nix" = { + type = "zfs_fs"; + mountpoint = "/nix"; + options = { + canmount = "noauto"; + mountpoint = "/nix"; + exec = "on"; + setuid = "on"; + }; + }; + "local/state" = { + type = "zfs_fs"; + mountpoint = "/state"; + options = { + canmount = "noauto"; + mountpoint = "/state"; + }; + }; + "safe" = { + type = "zfs_fs"; + }; + "safe/persist" = { + type = "zfs_fs"; + mountpoint = "/persist"; + options = { + canmount = "noauto"; + mountpoint = "/persist"; + }; + }; + }; + }; + }; + }; +}