From 2ab15c9cc67a60738e0b2478bfce6cd6de171c67 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Fri, 6 Jun 2025 11:54:32 -0500 Subject: [PATCH] add disk config --- disk-config.nix | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 disk-config.nix diff --git a/disk-config.nix b/disk-config.nix new file mode 100644 index 0000000..e0561dc --- /dev/null +++ b/disk-config.nix @@ -0,0 +1,63 @@ +{ + disko.devices = { + disk = { + x = { + device = "/dev/nvme0n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + # boot + ESP = { + size = "64M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + # root + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + }; + }; + }; + }; + }; + zpool = { + zroot = { + type = "zpool"; + # options.cachefile = "none"; + rootFsOptions = { + compression = "zstd"; + "com.sun:auto-snapshot" = "false"; + }; + + datasets = { + "root" = { + type = "zfs_fs"; + options.mountpoint = "/"; + mountpoint = "/"; + postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/root@blank$' || zfs snapshot zroot/root@blank"; + }; + "nix" = { + type = "zfs_fs"; + options.mountpoint = "/nix"; + mountpoint = "/nix"; + }; + "persist" = { + type = "zfs_fs"; + options.mountpoint = "/persist"; + mountpoint = "/persist"; + }; + }; + }; + }; + }; +}