Disko: how to set mountpoint ownership on a zfs dataset?

I could do it manually using sudo chown -R 1000:100 /somedataset
But is there a way to put it in the config?

    zpool.rpool = {
      ...
      datasets = {
        ...
        "nixos/safe/somedataset" = {
          type = "zfs_fs";
          mountpoint = "/somedataset";
          options.mountpoint = "legacy";
          # options.mountpoint = "/somedataset";
          options."com.sun:auto-snapshot" = "true";
        };
      };
    };

This hook seems to work.

          postMountHook = "chown -R 1000:100 /mnt/somedataset";
1 Like