Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disko.create fails when there are multiple disks #52

Closed
therishidesai opened this issue Nov 10, 2022 · 5 comments
Closed

disko.create fails when there are multiple disks #52

therishidesai opened this issue Nov 10, 2022 · 5 comments

Comments

@therishidesai
Copy link
Contributor

When I have the followign config:

cfg = {
    disk = {
      disk0 = {
        device = "/dev/sda";
        type = "disk";
        content = {
          type = "table";
          format = "gpt";
          partitions = [
            {
              name = "nix";
              type = "partition";
              part-type = "primary";
              start = "0%";
              end = "100%";
              bootable = true;
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/a";
              };
            }
          ];
        };
      };
      disk1 = {
        device = "/dev/sdb";
        type = "disk";
        content = {
          type = "table";
          format = "gpt";
          partitions = [
            {
              name = "root";
              type = "partition";
              part-type = "primary";
              start = "0%";
              end = "100%";
              bootable = true;
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/b";
              };
            }
          ];
        };
      };
    };
  };

disko.create cfg fails with the following error:

error: attribute 'deviceDependencies' missing

     at /home/rishi/disko/types.nix:134:61:

        133|     create = devices: let
        134|       sortedDeviceList = diskoLib.sortDevicesByDependencies (diskoLib.meta devices).deviceDependencies devices;
           |                                                             ^
        135|     in ''
@therishidesai
Copy link
Contributor Author

After doing some testing in the repl it seems like the _meta part of the devices attrs is not set to anything.

@Lassulus
Copy link
Collaborator

ah that is indeed a bug. I always expect some dependencies if there are multiple devices. Will fix it now

@Lassulus
Copy link
Collaborator

should be fixed by 78d9448 please reopen if not (although I have tested your config)

@Mic92
Copy link
Member

Mic92 commented Nov 10, 2022

Also a regression test would be nice.

Lassulus added a commit that referenced this issue Nov 10, 2022
@Lassulus
Copy link
Collaborator

@Mic92 there you go: d61fd15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants