From 0199e7a49d5f50cf9d865d3ebc3d845a0dedd7a3 Mon Sep 17 00:00:00 2001 From: kurogeek Date: Tue, 18 Aug 2026 16:47:06 +0700 Subject: [PATCH] mob next [ci-skip] [ci skip] [skip ci] lastFile:machines/buna/disko.nix --- machines/buna/disko.nix | 68 +++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/machines/buna/disko.nix b/machines/buna/disko.nix index e51f90f..1c93b0b 100644 --- a/machines/buna/disko.nix +++ b/machines/buna/disko.nix @@ -1,7 +1,7 @@ { ... }: let hashDisk = disk: "os-${builtins.substring 0 5 (builtins.hashString "sha256" disk)}"; - os = "/dev/disk/by-id/usb-Generic_MassStorageClass_000000001539-0:0"; + os = "/dev/disk/by-id/mmc-TLimmc_0xda6d8fbf"; in { @@ -14,6 +14,8 @@ in }; }; + boot.zfs.forceImportRoot = true; + disko.devices = { disk = { "os-${hashDisk os}" = { @@ -23,31 +25,65 @@ in type = "gpt"; partitions = { ESP = { - end = "500M"; + size = "1G"; type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; + mountOptions = [ "nofail" ]; }; }; - root = { - name = "root"; - end = "-0"; + system = { + size = "100%"; content = { - type = "filesystem"; - format = "f2fs"; - mountpoint = "/"; - extraArgs = [ - "-O" - "extra_attr,inode_checksum,sb_checksum,compression" - ]; - mountOptions = [ - "compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime,nodiscard" - ]; + type = "zfs"; + pool = "zroot"; }; }; + swap = { + size = "4G"; + content = { + type = "swap"; + }; + }; + }; + }; + }; + }; + zpool = { + zroot = { + type = "zpool"; + rootFsOptions = { + mountpoint = "none"; + compression = "lz4"; + acltype = "posixacl"; + xattr = "sa"; + "com.sun:auto-snapshot" = "true"; + }; + options.ashift = "12"; + datasets = { + "root" = { + type = "zfs_fs"; + options.mountpoint = "none"; + }; + "root/nixos" = { + type = "zfs_fs"; + options.mountpoint = "/"; + mountpoint = "/"; + }; + "root/home" = { + type = "zfs_fs"; + options.mountpoint = "/home"; + mountpoint = "/home"; + }; + "root/tmp" = { + type = "zfs_fs"; + mountpoint = "/tmp"; + options = { + mountpoint = "/tmp"; + sync = "disabled"; + }; }; }; };