!oNSIfazDqEcwhcOjSL:matrix.org

disko

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

Load older messages


SenderMessageTime
14 Aug 2025
@lassulus:lassul.uslassulusor formatScript17:24:07
@lassulus:lassul.uslassulus so something like systemd.services."zfs-import-tank".preStart = config.system.build.formatScript; 17:29:07
@x10an14:matrix.orgx10an14

Would any of you have any opinion on which of these two alternatives are better/safer/preferable?

{
  _file = ./auto-create.nix;
  flake.modules.nixos."nas-2024" =
    { config, lib, ... }:
    let
      # https://discourse.nixos.org/t/configure-zfs-filesystems-after-install/48633/2
      zfsDatasets =
        config.disko.devices.zpool
        |> lib.attrsToList
        |> lib.foldl' (
          acc: zpool:
          acc
          ++ (
            zpool.value.datasets
            |> lib.attrValues
            |> lib.filter (dataset: dataset.name != "__root")
            |> lib.map (dataset: {
              zpool = zpool.name;
              inherit (dataset) name mountpoint;
              creationScript = dataset._create;
            })
          )
        ) [ ];
      diskoFormatScript = lib.getExe config.system.build.formatScript;
    in
    {
      # Perform the "create new datasets/zvols" operation
      systemd.services = {
        "zfs-import-tank".preStart = diskoFormatScript;
        # "zfs-import-nvmepool".preStart = diskoFormatScript; # Don't need this yet
      }
      // (
        zfsDatasets
        |> lib.filter (dataset: dataset.name == "doesn't exist") # Disable for now
        |> lib.map (
          dataset:
          lib.nameValuePair "zfs-create-${dataset.zpool}-${lib.replaceString "/" "_" dataset.name}" {
            unitConfig.DefaultDependencies = false;
            requiredBy = [ "local-fs.target" ];
            before = [ "local-fs.target" ];
            after = [
              "zfs-import-${dataset.zpool}.service"
              "zfs-mount.service"
            ];
            unitConfig.ConditionPathIsMountPoint = lib.mkIf (
              dataset.mountpoint != null
            ) "!${dataset.mountpoint}";
            script = dataset.creationScript;
          }
        )
        |> lib.listToAttrs
      );
    };
}
21:01:21
@waltmck:matrix.orgwaltmck

In my opinion Disko would benefit from natively supporting this kind of thing---I have run into this too, and when tweaking my dataset properties it is a pain to try to keep them in sync with my Disko config.

One idea is to have a boolean dataset attribute datasets.<name>.followConfig or similar. If this is set, then on activation (and boot) Disko will try to set the dataset properties to match the config.

Balancing idempotency with the desire to not lose data accidentally is tricky---if you delete a dataset from your config, should Disko delete the dataset from your pool? One idea is to use a custom ZFS user property to identify datasets which are being managed by Disko; this would allow deleting dataset which no longer appear in yoru config, while keeping the ability for people to manually create unmanaged datasets

22:53:56
@waltmck:matrix.orgwaltmck *

In my opinion Disko would benefit from natively supporting this kind of thing---I have run into this too, and when tweaking my dataset properties it is a pain to try to keep them in sync with my Disko config.

One idea is to have a boolean dataset attribute datasets.<name>.followConfig or similar. If this is set, then on activation (and boot) Disko will try to set the dataset properties to match the config.

Balancing idempotency with the desire to not lose data accidentally is tricky---if you delete a dataset from your config, should Disko delete the dataset from your pool? One idea is to use a custom ZFS user property to identify datasets which are being managed by Disko; this would allow deleting datasets which no longer appear in your config, while keeping the ability for people to manually create unmanaged datasets

22:54:31
@waltmck:matrix.orgwaltmck *

In my opinion Disko would benefit from natively supporting this kind of thing---I have run into this too, and when tweaking my dataset properties it is a pain to try to keep them in sync with my Disko config.

One idea is to have a boolean dataset attribute datasets.<name>.managed or similar. If this is set, then on activation (and boot) Disko will try to set the dataset properties to match the config.

Balancing idempotency with the desire to not lose data accidentally is tricky---if you delete a dataset from your config, should Disko delete the dataset from your pool? One idea is to use a custom ZFS user property to identify datasets which are being managed by Disko; this would allow deleting datasets which no longer appear in your config, while keeping the ability for people to manually create unmanaged datasets

22:55:19
@waltmck:matrix.orgwaltmckWould a PR for this be welcome, or do you consider it out of scope?22:58:36
15 Aug 2025
@notahacker666:matrix.orgL33tT33n They can't even merge a few lines of code to fix a critical bug for almost a week now, lol
Do you think that somebody cares about your stuff here?
02:44:18
@sandro:supersandro.deSandro 🐧 First of all this is pretty disrespectful.
Second: yeah, the set +x is probably shadowing the exit code.
Third: would I call this critical? Probably not but it is still a bug which should be fixed
10:31:42
@notahacker666:matrix.orgL33tT33nRespect must be deserved And I think that bricked hard drive because of a typo is critical enough, isn't it?11:39:08
@magic_rb:matrix.redalder.orgmagic_rbThe disko people deserve your respect just for writing this and making it free software. Feel free to fork or start from scratch if you don't like how the project is run. But don't attack people11:41:15
@magic_rb:matrix.redalder.orgmagic_rbI do get youre angry, you lost a disk, but you wont get the fix merged by being an ass. (As someone who still struggles with anger, i get ya)11:47:29
@notahacker666:matrix.orgL33tT33nLuckily, I'm not so short-sighted as to rely on the amateur software But here's a fact: a random guy had fixed this bug for a maintainer almost a week ago, and his commit wasn't even merged When the free and open source software can brick your important data or make bad guys steel it, AND the dev doesn't care at all then it's not good and useful software anymore Are you guys also fixing RCEs like that?12:00:32
@lassulus:lassul.uslassulusRCEs will usually be fixed faster, but if you rely on things it's always good to have your own fork to rely on12:01:59
@lassulus:lassul.uslassulusluckily this is quite easy with nix and OSS software12:02:20
@lassulus:lassul.uslassulusthe askPassword thing is annoying but not really critical12:02:37
@maralorn:maralorn.demaralorn
In reply to @notahacker666:matrix.org
Respect must be deserved
And I think that bricked hard drive because of a typo is critical enough, isn't it?
Probably offtopic, but I fundamentally disagree with the first sentence. In my opinion every human being deserves respect unconditionally.
12:44:24
@notahacker666:matrix.orgL33tT33nIt is offtopic, my fellow liberal friend. Do you respect stalin by the way?13:03:55
@lassulus:lassul.uslassulusI guess every person starting with respect does not mean they cannot lose it through their actions. But this getting pretty offtopic for here now, so please talk about disko instead here :)13:10:11
16 Aug 2025
@waltmck:matrix.orgwaltmck
In reply to @waltmck:matrix.org
Would a PR for this be welcome, or do you consider it out of scope?
This question got kind of derailed but I am still interested in whether actively managing datasets is something that you all would consider in-scope for disko
05:00:28
@x10an14:matrix.orgx10an14I think I finally managed it today! But w/options in my own config, lmk if anyone's interested in taking a peek12:38:45
@beat_link:matrix.orgBeatLink set a profile picture.22:30:28
17 Aug 2025
@s:consortium.chatshelvacu
In reply to @waltmck:matrix.org
This question got kind of derailed but I am still interested in whether actively managing datasets is something that you all would consider in-scope for disko
I'm not a maintainer or anything, but I certainly would love it
00:49:27
@noneyescat:matrix.orgmomo I have No space left on device problem when I using this config to install. The installing command is nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- -f .#server. Does anyone know how to solve this problem? 03:09:39
@rob.sliwi:matrix.orgrobsliwiCan you share some logs?07:40:31
@berrij:fairydust.spaceBerriJ joined the room.07:46:07
@ethancedwards8:matrix.orgethancedwards8 joined the room.08:23:42
@shawn8901:matrix.orgshawn8901 joined the room.09:07:53
@noneyescat:matrix.orgmomo
In reply to @rob.sliwi:matrix.org
Can you share some logs?
https://fars.ee/664p
15:19:07
@rob.sliwi:matrix.orgrobsliwiSeems like your build host is simply filled to the max with its disk space?16:38:26

Show newer messages


Back to Room ListRoom Version: 10