!oNSIfazDqEcwhcOjSL:matrix.org

disko

379 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko97 Servers

Load older messages


SenderMessageTime
7 Feb 2026
@neochaotics:matrix.orgSKREE changed their profile picture.17:19:46
@neochaotics:matrix.orgSKREE changed their profile picture.17:20:19
@neochaotics:matrix.orgSKREE changed their profile picture.17:20:52
@neochaotics:matrix.orgSKREE changed their display name from Doopa to SKREE.17:21:19
@neochaotics:matrix.orgSKREE changed their profile picture.17:22:29
@neochaotics:matrix.orgSKREE changed their profile picture.17:23:27
8 Feb 2026
@alphakeks:matrix.orgAlphaKeks joined the room.19:32:31
@alphakeks:matrix.orgAlphaKeks

Hey, I'm experiencing an issue with postMountHook. I have a zfs pool that looks roughly like this:

{
  type = "zpool";

  options = {
    ashift = "12";
  };

  rootFsOptions = {
    acltype = "posix";
    compression = "on";
    mountpoint = "none";
    overlay = "off";
    xattr = "sa";
  };

  datasets =
    let
      mkDataset = lib.attrsets.recursiveUpdate {
        type = "zfs_fs";
      };
    in
    {
      "rootfs" = mkDataset {
        mountpoint = "/";
      };

      "home" = mkDataset {
        mountpoint = "/home";
      };

      "home/user" = mkDataset {
        name = "home/${config.custom.username}";
        mountpoint = "/home/${config.custom.username}";

        options = {
          mountpoint = "/home/${config.custom.username}";
          encryption = "on";
          keyformat = "passphrase";
          keylocation = "prompt";
          "com.sun:auto-snapshot" = "true";
        };

        postMountHook = ''
          # ...
        '';
      };
    };
}

(other datasets omitted for the sake of brevity)

Initially I did not specify options.mountpoint, and ran into the problem that my dataset was not mounted by the time postMountHook got executed. I saw the zfs example in the disko repo using both mountpoint and options.mountpoint, so I figured I'd give it a shot. Now the problem is that it remains mounted when the main disko script tries to mount the rest, which then fails because /mnt is not empty... The error message:

+ findmnt nixos/rootfs /mnt/
+ mount nixos/rootfs /mnt/ -o X-mount.mkdir -o defaults -o zfsutil -t zfs
zfs_mount_at() failed: directory is not empty+ rm -rf /tmp/tmp.aSJMo4rNbE

I don't know if I'm doing something wrong or if the script generation is just broken?

20:01:15
@alphakeks:matrix.orgAlphaKeks *

Hey, I'm experiencing an issue with postMountHook. I have a zfs pool that looks roughly like this:

{
  type = "zpool";

  options = {
    ashift = "12";
  };

  rootFsOptions = {
    acltype = "posix";
    compression = "on";
    mountpoint = "none";
    overlay = "off";
    xattr = "sa";
  };

  datasets =
    let
      mkDataset = lib.attrsets.recursiveUpdate {
        type = "zfs_fs";
      };
    in
    {
      "rootfs" = mkDataset {
        mountpoint = "/";
      };

      "home" = mkDataset {
        mountpoint = "/home";
      };

      "home/${config.custom.username}" = mkDataset {
        mountpoint = "/home/${config.custom.username}";

        options = {
          mountpoint = "/home/${config.custom.username}";
          encryption = "on";
          keyformat = "passphrase";
          keylocation = "prompt";
          "com.sun:auto-snapshot" = "true";
        };

        postMountHook = ''
          # ...
        '';
      };
    };
}

(other datasets omitted for the sake of brevity)

Initially I did not specify options.mountpoint, and ran into the problem that my dataset was not mounted by the time postMountHook got executed. I saw the zfs example in the disko repo using both mountpoint and options.mountpoint, so I figured I'd give it a shot. Now the problem is that it remains mounted when the main disko script tries to mount the rest, which then fails because /mnt is not empty... The error message:

+ findmnt nixos/rootfs /mnt/
+ mount nixos/rootfs /mnt/ -o X-mount.mkdir -o defaults -o zfsutil -t zfs
zfs_mount_at() failed: directory is not empty+ rm -rf /tmp/tmp.aSJMo4rNbE

I don't know if I'm doing something wrong or if the script generation is just broken?

20:02:03
@knowledgeless:unredacted.orgknowledgeless joined the room.21:06:33
9 Feb 2026
@tumble1999:matrix.orgTumble does disko just use nixosModule.config.disko.devices
im thinking i probably dont need to make a lib function and maybe just make a nixos config
17:59:26
@lassulus:lassul.uslassulusyes, depending on what you want to do20:02:58
@tumble1999:matrix.orgTumble i want to just make one disko config where i just specify os drive and optional home and zfs drives and it will make a partition layout the way i want it
and use it across all my systems
20:46:26
10 Feb 2026
@mon:tchncs.depneumatic changed their display name from ribosomerocker to pneumatic.10:28:36
@h4rdstyl3z:matrix.orgh4rdstyl3z joined the room.19:27:12
@h4rdstyl3z:matrix.orgh4rdstyl3zHey everyone! I'm looking into using disko for an upcoming install and I have a question that I couldn't find an answer to in the documentation/examples: is there a specific option that has to be set in order for disko not to format a given partition (for instance, in the case of boot, in which it might not be desirable to format it if you're dual-booting)? The gpt-unformatted example doesn't seem to show any specific option to do that, is it just done through the CLI tool?19:32:45
@h4rdstyl3z:matrix.orgh4rdstyl3zAh, apparently this use case is not supported, actually https://github.com/nix-community/disko/issues/995#issuecomment-272513265220:44:41
@h4rdstyl3z:matrix.orgh4rdstyl3zWell, good to know anyhow20:44:48
@crony:cronyakatsuki.xyzCrony Akatsuki changed their profile picture.21:32:31
11 Feb 2026
@bandithedoge:matrix.org@bandithedoge:matrix.org changed their display name from bandithedoge to bandithedoge (-> @bandithedoge:zimward.moe).16:22:46
@bandithedoge:zimward.moebandithedoge joined the room.16:57:36
@bandithedoge:matrix.org@bandithedoge:matrix.org left the room.16:57:49
12 Feb 2026
@rungmc:matrix.org@rungmc:matrix.org removed their display name rungmc.05:54:52
@rungmc:matrix.org@rungmc:matrix.org left the room.05:54:58
25 Apr 2024
@zraexy:nixos.devDavid Mell (zraexy) joined the room.23:38:25
@zraexy:nixos.devDavid Mell (zraexy) changed their display name from David Mell to David Mell (zraexy).23:51:57
26 Apr 2024
@raj-magesh:matrix.orgRaj

Couple of questions about NixOS live USBs:

I want to partition my 64 GB USB flash drive into two partitions (FAT32 live USB + ext4 storage), so I used the following disko config:

let
  usb = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401a943ae4197a38a6f9070194e9ea2b3fb8dbb7997e05ed1b197c0e28946be4b8f000000000000000000001cf4be6800926418a955810751ab6336-0:0";
in {
  disko.devices = {
    disk = {
      live = {
        type = "disk";
        device = usb;
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              device = "${usb}-part1";
              priority = 0;
              size = "8192M";
              content = {
                type = "filesystem";
                format = "vfat";
              };
            };
            storage = {
              device = "${usb}-part2";
              priority = 1;
              size = "100%";
              content = {
                type = "filesystem";
                format = "ext4";
              };
            };
          };
        };
      };
    };
  };
}

I then copied over the files from the (minimal, non-graphical) NixOS live ISO into partition 1, hoping that the instructions on the Arch wiki would generalize to NixOS, but then my live ISO gets stuck with the following error message:

[...]
Timed out waiting for device /dev/root, trying to mount anyway
mounting /dev/root on /iso...
mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory

An error occurred [...]

How can I use my USB flash drive as both a live USB and as a storage device? I found this relevant Discourse link but there was no resolution to the problem there.

I realize this might not be the best place to ask this, but I figured that folks here would have expertise configuring boot partitions correctly.

02:02:16
@raj-magesh:matrix.orgRaj *

Couple of questions about NixOS live USBs:

I want to partition my 64 GB USB flash drive into two partitions (FAT32 live USB + ext4 storage), so I used the following disko config:

let
  usb = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401a943ae4197a38a6f9070194e9ea2b3fb8dbb7997e05ed1b197c0e28946be4b8f000000000000000000001cf4be6800926418a955810751ab6336-0:0";
in {
  disko.devices = {
    disk = {
      live = {
        type = "disk";
        device = usb;
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              device = "${usb}-part1";
              priority = 0;
              size = "8192M";
              content = {
                type = "filesystem";
                format = "vfat";
              };
            };
            storage = {
              device = "${usb}-part2";
              priority = 1;
              size = "100%";
              content = {
                type = "filesystem";
                format = "ext4";
              };
            };
          };
        };
      };
    };
  };
}

I then copied over the files from the (minimal, non-graphical) NixOS live ISO into partition 1, hoping that the instructions on the Arch wiki would generalize to NixOS, but then my live ISO gets stuck with the following error message:

[...]
Timed out waiting for device /dev/root, trying to mount anyway
mounting /dev/root on /iso...
mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory

An error occurred [...]

How can I use my USB flash drive as both a live USB and as a storage device? I found this relevant Discourse link but there was no resolution to the problem there.

I realize this might not be the best place to ask this, but I figured that folks here would have expertise configuring boot partitions correctly.

For reference, the NixOS manual says I should dd the ISO to the disk directly: sudo dd if=<path-to-image> of=/dev/sdX bs=4M conv=fsync

02:12:28
@tim92:matrix.orgtimI don't think that this will work since you need to unmount the live USB to format it as storage device07:16:00
@raj-magesh:matrix.orgRaj
In reply to @tim92:matrix.org
I don't think that this will work since you need to unmount the live USB to format it as storage device
Not sure what you mean, exactly. To clarify, I'm not trying to format the USB while it's live; I'm running this from an existing NixOS install.

If the"live USB" bit uses only ~1 GiB, there should be some way to make use of the remaining space, hopefully.
07:57:47

Show newer messages


Back to Room ListRoom Version: 10