!oNSIfazDqEcwhcOjSL:matrix.org

disko

383 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko101 Servers

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


SenderMessageTime
13 Aug 2025
@matthewcroughan:defenestrate.itmatthewcroughan changed their display name from matthewcroughan @ WHY2025 (DECT: 8793) to matthewcroughan.17:21:37
14 Aug 2025
@x10an14:matrix.orgx10an14

I want to leverage disko to create datasets for me post-install/initial set-up. I found this suggestion on discourse, and that works for those who've get all their disko config in 1x file (or 1x file that imports all/any other) per machine.
https://discourse.nixos.org/t/add-dataset-to-pool-after-creation-in-disko/62244/2

I don't have my disko config conveniently collated into a variable like that, so I'm wondering how I can achieve something like the below w/disko (the below gives error: stack overflow; max-call-depth exceeded error)?

{
  _file = ./auto-create.nix;
  flake.modules.nixos."nas-2024" =
    {
      config,
      pkgs,
      lib,
      ...
    }:
    let
      preStart =
        # bash
        ''${lib.getExe pkgs.disko} --mode format ${
          pkgs.writeText "disko.nix" (lib.generators.toPretty { } { inherit (config) disko; })
        }'';
    in
    {
      # Perform the "create new datasets/zvols" operation
      systemd.services."zfs-import-tank".preStart = preStart;
      # systemd.services."zfs-import-nvmepool".preStart = preStart; # Don't need this yet
    };
}

PS: I make heavy use of https://flake.parts/options/flake-parts-modules.html, which allow me to split configuration like shown above easily across files

17:17:19
@lassulus:lassul.uslassulusjust get config.system.build.format instead of running the cl17:22:09
@lassulus:lassul.uslassulus* just get config.system.build.format instead of running the cli17:22:13
@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

Show newer messages


Back to Room ListRoom Version: 10