!oNSIfazDqEcwhcOjSL:matrix.org

disko

352 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko89 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
10 Jul 2025
@bbigras:matrix.orgbbigras joined the room.18:20:56
@0x4a6f:matrix.org[0x4A6F]

This might work for hibernation:

  disko.devices = {
    disk = {
      nvme0n1 = {
        device = "/dev/nvme0n1";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            boot = {
              priority = 1;
              start = "34s";
              end = "2047s";
              type = "EF02"; # for grub MBR
            };
            ESP = {
              priority = 2;
              start = "2048s";
              end = "2099199s";
              type = "EF00";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
              };
            };
            luks = {
              priority = 3;
              start = "2099200s";
              end = "100%";
              type = "8309";
              content = {
                type = "luks";
                name = "crypted-nvme0n1";
                settings = {
                  allowDiscards = true;
                };
                content = {
                  type = "lvm_pv";
                  vg = "nvme0n1";
                };
              };
            };
          };
        };
      };
    };
    lvm_vg = {
      nvme0n1 = {
        type = "lvm_vg";
        lvs = {
          # LVs are created in alphabetic order for some reason
          # Prefixing them with a letter like this ensures desired creation order
          a_swap = {
            size = "64GiB"; # equal size to maximum available RAM
            content = {
              type = "swap";
            };
          };
          z_data = {
            size = "100%FREE";
            content = {
              type = "zfs";
              pool = "root";
            };
          };
        };
      };
    };
    zpool = {
      root = {
        type = "zpool";
        rootFsOptions = {
          compression = "lz4";
          "com.sun:auto-snapshot" = "false";
          mountpoint = "none";
          reservation = "16G";
        };
        postCreateHook = ''
          zfs snapshot root@blank;
          zfs snapshot root/nixos@blank;
          zfs snapshot root/nix@blank;
          zfs snapshot root/home@blank;
          zfs snapshot root/persist@blank
        '';

        datasets = {
          nixos = {
            type = "zfs_fs";
            mountpoint = "/";
            options.mountpoint = "legacy";
          };
          nix = {
            type = "zfs_fs";
            mountpoint = "/nix";
            options.mountpoint = "legacy";
          };
          home = {
            type = "zfs_fs";
            mountpoint = "/home";
            options.mountpoint = "legacy";
            options."com.sun:auto-snapshot" = "true";
          };
          persist = {
            type = "zfs_fs";
            mountpoint = "/persist";
            options.mountpoint = "legacy";
            options."com.sun:auto-snapshot" = "true";
          };
        };
      };
    };
  };

But be aware of zfs#12842 - make Linux hibernation (suspend-to-disk) more robust and nixpkgs#208037 - nixos/zfs: mitigate data loss issues when resuming from hibernate

You might also need these to enter the danger territory (make yourself familiar with zpool recovery strategy):

  boot.zfs.allowHibernation = true;
  boot.zfs.forceImportRoot = false;
  boot.zfs.forceImportAll = false;
21:17:01
@steeringwheelrules:tchncs.de@steeringwheelrules:tchncs.dethank you! I will try and play with this23:28:11
11 Jul 2025
@cathal_mullan:matrix.orgCathal joined the room.19:53:53
13 Jul 2025
@marie:marie.cologneMarie changed their profile picture.20:11:57
14 Jul 2025
@bbigras:matrix.orgbbigrasIs btrs okay for hibernation?23:11:06
15 Jul 2025
@steeringwheelrules:tchncs.de@steeringwheelrules:tchncs.debeen using it for years now and hadn't had any issues with hibernation17:53:55
@bbigras:matrix.orgbbigras
                    "/swap" = {
                      mountpoint = "/.swapvol";
                      swap.swapfile.size = "20M";
                    };

https://github.com/nix-community/disko/blob/2bf3421f7fed5c84d9392b62dcb9d76ef09796a7/example/luks-btrfs-subvolumes.nix#L57-L60

Is this a swap partition or a swap file?

19:31:30
@blimbus:matrix.orgblimbusswap file20:47:47
17 Jul 2025
@ersei:ersei.net@ersei:ersei.net left the room.15:35:11
@tvd:matrix.orgTom joined the room.19:09:10
@bbigras:matrix.orgbbigras swap.swapfile.size = "20M"; Why only 20M? will it grow on itself? 22:48:14
@mon:tchncs.deribosomerocker joined the room.23:58:44
18 Jul 2025
@dont.wanna.tell:matrix.org@dont.wanna.tell:matrix.org left the room.09:24:48
21 Jul 2025
@pink_rocky:tchncs.derocky ((λ💝.💝)💐) (she/they; ask before DM please) changed their display name from pink_rocky to pink_rocky (she/they; ask before DM please).07:30:57
@ab-kein:matrix.orgAb Kein set a profile picture.15:54:48
@tioan:dunwyn.xyztioan joined the room.22:16:20
22 Jul 2025
@joerg:thalheim.ioMic92it's a unit test18:15:29
@solidhal:matrix.orgsolideva joined the room.20:40:46
23 Jul 2025
@lotte:chir.rs@lotte:chir.rs changed their profile picture.10:16:20
24 Jul 2025
@blocklisted:matrix.orgblocklisted joined the room.10:08:43
27 Jul 2025
@sodiboo:gaysex.cloudsodiboo joined the room.13:19:48
28 Jul 2025
@sylvie:karp.lolSylvie (They/She) 🏳️‍⚧️ joined the room.10:36:37
29 Jul 2025
@sinan:sinanmohd.comsinan joined the room.11:41:37
@sinan:sinanmohd.comsinan20250729_17h18m42s_grim.png
Download 20250729_17h18m42s_grim.png
12:17:35
@sinan:sinanmohd.comsinanss.png
Download ss.png
12:17:47

Show newer messages


Back to Room ListRoom Version: 10