!oNSIfazDqEcwhcOjSL:matrix.org

disko

354 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko88 Servers

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


SenderMessageTime
4 Feb 2024
@waterturkey:matrix.orgwaterturkey
In reply to @dave:tiredofit.ca
BTRFS Raid 1 will work with Disko May I suggest if it is giving you problems set up your subvolumes on your second disk instead of the first. Otherwise I have a few examples of it here: https://github.com/tiredofit/nixos-config/tree/main/templates/disko
Thanks! This is exactly what I was looking for.
09:38:17
11 Feb 2024
@guanran928:mozilla.org@guanran928:mozilla.org changed their display name from Charles He | moved -> @lime:catgirl.cloud to Charles He.07:16:05
@eyjhb:eyjhb.dkeyJhb
{ lib, ... }:

{
  disko.devices = {
    disk.disk1 = {
      type = "disk";
      device = lib.mkDefault "/dev/sda";
      content = {
        type = "gpt";
        partitions = {
          boot = {
            name = "boot";
            size = "1M";
            type = "EF02";
          };
          esp = {
            name = "ESP";
            size = "500M";
            type = "EF00";
            content = {
              type = "filesystem";
              format = "vfat";
              mountpoint = "/boot";
            };
          };
          zfs = {
            size = "100%";
            content = {
              type = "zfs";
              pool = "zpool";
            };
          };
        };
      };
    };
    zpool = {
      rpool = {
        type = "zpool";
        # mode = "mirror";
        rootFsOptions.compression = "zstd";
        # rootFsOptions."com.sun:auto-snapshot" = "false";

        datasets = {
          "root" = {
            type = "zfs_fs";
            mountpoint = "/";
            options.mountpoint = "legacy";
            postCreateHook = "zfs snapshot rpool/root@blank";
          };
          "local/nix" = {
            type = "zfs_fs";
            mountpoint = "/nix";
            options.mountpoint = "legacy";
          };
          "local/stash" = {
            type = "zfs_fs";
            mountpoint = "/state/stash";
            options.mountpoint = "legacy";
          };

          # safe 
          "safe/home" = {
            type = "zfs_fs";
            mountpoint = "/state/home";
            options.mountpoint = "legacy";
          };
          "safe/persistent" = {
            type = "zfs_fs";
            mountpoint = "/state/root";
            options.mountpoint = "legacy";
          };
        };
      };
    };
  };
}


11:59:25
@eyjhb:eyjhb.dkeyJhb

Anyone that can see the flaw in that config? Error is

+ readarray -t zfs_devices
++ cat /tmp/tmp.gk3UVSF6cj/zfs_rpool
cat: /tmp/tmp.gk3UVSF6cj/zfs_rpool: No such file or directory
+ zpool create -f rpool -R /mnt -O compression=zstd
missing vdev specification
usage:
	create [-fnd] [-o property=value] ...
	    [-O file-system-property=value] ...
	    [-m mountpoint] [-R root] <pool> <vdev> ...
+ rm -rf /tmp/tmp.gk3UVSF6cj

11:59:42
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)Doesn't look like the partitions are the same as the example12:01:18
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)https://github.com/nix-community/disko/blob/master/example/zfs.nix#L9-L2712:01:23
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) you don't have a partitions.boot.content 12:01:35
@eyjhb:eyjhb.dkeyJhbThey are yoinked directly from here https://github.com/nix-community/nixos-anywhere-examples/blob/main/disk-config.nix#L9-L2512:02:14
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) you have disk.disk1.content instead of idks.disk1.partitions.boot.content 12:02:17
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) * you have disk.disk1.content instead of diss.disk1.partitions.boot.content 12:02:22
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) * you have disk.disk1.content instead of disk.disk1.partitions.boot.content 12:02:33
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)the nixos-anywhere examples may be outdated compared to the disko examples which have tests for them 12:02:50
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)what you can do is try to make a test for this disk-config.nix directly in the disko repo and try to run the VM test for that, to see if it works or gives you the same error12:03:21
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)it's hard to debug otherwise, unless a VM test is made12:03:27
@eyjhb:eyjhb.dkeyJhbThe disk-config.nix works for the nixos-anywhere-examples, but not when I've tried to change it to zfs12:03:49
@eyjhb:eyjhb.dkeyJhb * The disk-config.nix works from the nixos-anywhere-examples, but not when I've tried to change it to zfs12:04:03
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)oh, well then you need to follow the zfs example that I linked 12:04:05
@eyjhb:eyjhb.dkeyJhbThat's what I've been trying to follow :p - I'm very unsure what should be in the file it tries to cat.12:04:30
@eyjhb:eyjhb.dkeyJhbI think I found the issue12:04:48
@eyjhb:eyjhb.dkeyJhbTrying again12:04:51
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)I can't spot the problem directly in your example, because this is one of the larger modules with deeply nested options, so it's quite hard, but I assure you that if you put your code on the left, and the ZFS example on the right, you will spot it 12:04:52
@lassulus:lassul.uslassulusPool should be rpool12:06:23
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)ah damn :D 12:06:29
@lassulus:lassul.uslassulusNot zpool12:06:31
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)is there no way to have Nix warn you about that, like "Did you mean rpool?"12:06:45
@eyjhb:eyjhb.dkeyJhb
In reply to @lassulus:lassul.us
Pool should be rpool
Yeah, that's the thing I'm trying now. I changed it once, but ... I just changed it from zroot to zpool..............
12:07:02
@eyjhb:eyjhb.dkeyJhb
In reply to @matthewcroughan:defenestrate.it
is there no way to have Nix warn you about that, like "Did you mean rpool?"
Make it include clippy as well. Disko clippy
12:07:30
@eyjhb:eyjhb.dkeyJhbNice, now it doesn't fail while creating the disks! 12:07:54
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)Hopefully zfs goes away and we get all the features in bcachefs12:07:59
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)less to maintain if that happens12:08:13

Show newer messages


Back to Room ListRoom Version: 10