From 9d887bf07ac1dec542028212909b9ac7e461d0db Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sun, 9 Feb 2025 00:04:30 +0100 Subject: core stuff, snorlax zfs --- configuration/snorlax/disk-config.nix | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'configuration/snorlax/disk-config.nix') diff --git a/configuration/snorlax/disk-config.nix b/configuration/snorlax/disk-config.nix index aa789a3..8c910d6 100644 --- a/configuration/snorlax/disk-config.nix +++ b/configuration/snorlax/disk-config.nix @@ -7,14 +7,9 @@ content = { type = "gpt"; partitions = { - MBR = { - type = "EF02"; # for grub MBR - size = "1M"; - priority = 1; # Needs to be first partition - }; ESP = { type = "EF00"; - size = "500M"; + size = "64M"; content = { type = "filesystem"; format = "vfat"; @@ -22,17 +17,36 @@ mountOptions = [ "umask=0077" ]; }; }; - root = { + zfs = { size = "100%"; content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; + type = "zfs"; + pool = "zroot"; }; }; }; }; }; }; + + zpool = { + zroot = { + type = "zpool"; + rootFsOptions = { + compression = "zstd"; + "com.sun:auto-snapshot" = "false"; + }; + mountpoint = "/"; + postCreateHook = "zfs list -t snap -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; + + datasets = { + git = { + type = "zfs_fs"; + mountpoint = "/var/lib/git"; + options."com.sun:auto-snapshot" = "true"; + }; + }; + }; + }; }; } -- cgit v1.2.3