!oNSIfazDqEcwhcOjSL:matrix.org

disko

406 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko109 Servers

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


SenderMessageTime
11 Feb 2025
@projectinitiative:matrix.orgprojectinitiative *

Are there any good examples of how to use the topsorted function? Doing some digging in nix repl for the mdadm example, I see this behavior:

nix-repl> inputs.nixpkgs.lib.lists.last nixosConfigurations.testmachine.config.disko.devices._meta.deviceDependencies.mdadm.raid1
[
  "disk"
  "/dev/my-disk"
]

nix-repl> builtins.head nixosConfigurations.testmachine.config.disko.devices._meta.deviceDependencies.mdadm.raid1
[
  "disk"
  "/dev/my-disk"
]

Seems a bit odd only one element is in the list. And I wonder if this is why my new types are not getting ordered properly, because they follow the same structure as mdadm/mdraid.

14:17:08
@projectinitiative:matrix.orgprojectinitiative *

Are there any good examples of how to use the sortDevicesByDependencies function? Doing some digging in nix repl for the mdadm example, I see this behavior:

nix-repl> inputs.nixpkgs.lib.lists.last nixosConfigurations.testmachine.config.disko.devices._meta.deviceDependencies.mdadm.raid1
[
  "disk"
  "/dev/my-disk"
]

nix-repl> builtins.head nixosConfigurations.testmachine.config.disko.devices._meta.deviceDependencies.mdadm.raid1
[
  "disk"
  "/dev/my-disk"
]

Seems a bit odd only one element is in the list. And I wonder if this is why my new types are not getting ordered properly, because they follow the same structure as mdadm/mdraid.

14:18:06
@lassulus:lassul.uslassulusit should just be the attribute you depend on, so in this case disko.devices.mdadm.raid1 depends on disko.devices.disk."/dev/my-disk"14:19:49
@lassulus:lassul.uslassulusand the toposort then sorts the snippet for disk."/dev/my-disk" before the snipper for mdadm.raid114:21:03
@lassulus:lassul.uslassulusbut if your raid depends on multiple disks, there should be multiple disks in there14:23:18
@projectinitiative:matrix.orgprojectinitiativelooking at example/mdadm.nix, two disks are defined with mdadm and then mdraid as the content, shouldn't both be included? I guess ultimately I am trying to figure out why my types that are modeled after the zfs and mdadm patterns are not respecting the same order when they get combined in the final _create. i.e. the mdraid equivalent bcachefs_member type (for members of the pool) needs to come first, yet it gets put after the bachefs type I made. Both types are nearly identical in structure14:23:25
@projectinitiative:matrix.orgprojectinitiativeI will note I also tried with the zfs-with-vdevs example adding it to the test machine config, and it also only has one disk listed under dependencies despite having several listed in the example file under zroot14:24:54
@lassulus:lassul.uslassulushmm, maybe there is indeed a bug14:25:56
@lassulus:lassul.uslassuluswhich didn't get triggered yet, but I thought the complex example would take care of that14:26:17
@projectinitiative:matrix.orgprojectinitiative

reproduction steps:

      nixosConfigurations.testmachine = lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./tests/disko-install/configuration.nix
          # ./example/hybrid.nix
          ./module.nix
          # ./example/bcachefs-multi-disk.nix
          # ./example/mdadm.nix
          ./example/zfs-with-vdevs.nix
        ];

  • add different examples to load and play around with
  • load the flake into nix repl
  • look at some of the _meta.deviceDependencies
14:27:29
@projectinitiative:matrix.orgprojectinitiative *

reproduction steps:

      nixosConfigurations.testmachine = lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./tests/disko-install/configuration.nix
          # ./example/hybrid.nix
          ./module.nix
          # ./example/bcachefs-multi-disk.nix
          # ./example/mdadm.nix
          ./example/zfs-with-vdevs.nix
        ];

  • add different examples to load and play around with toggling various configs
  • load the flake into nix repl
  • look at some of the _meta.deviceDependenciese
14:27:59
@lassulus:lassul.uslassulusI will try to add that to my thaigersprint todo list tomorrow :D14:28:16
@projectinitiative:matrix.orgprojectinitiativeObligatory: I wish nix had better testing/debugging tools, this is taking way longer to nail down my overall issue haha...14:30:10
@shift:c-base.orgshift
In reply to @lassulus:lassul.us
I will try to add that to my thaigersprint todo list tomorrow :D
You want issues for your sprint? Haha
20:09:11
12 Feb 2025
@lassulus:lassul.uslassulusYou have more? :D01:38:19
@projectinitiative:matrix.orgprojectinitiative
In reply to @lassulus:lassul.us
I will try to add that to my thaigersprint todo list tomorrow :D
I looked up that thaigersprint was, that seems unique. Talk about a cool experience
03:48:41
@projectinitiative:matrix.orgprojectinitiative* I looked up what thaigersprint was, that seems unique. Talk about a cool experience03:48:49
@lassulus:lassul.uslassulusok, deepMergeMap actually doesn't merge lists, since recursiveUpdate doesn't take care of that05:31:21
@lassulus:lassul.uslassulus projectinitiative: https://github.com/nix-community/disko/pull/963 10:21:50
@projectinitiative:matrix.orgprojectinitiativelooks like this fixed the deviceDendencies list not showing up! I now just have to figure out why my type ordering is not working correctly.14:49:36
@lassulus:lassul.uslassulusIf you have a PR with the current state I could take a look tomorrowish15:17:11

Show newer messages


Back to Room ListRoom Version: 10