Skip to content

Using disko with Macbook (Asahi NixOS) #1125

@sezaru

Description

@sezaru

Sorry for creating an issue for a question, but I tried to search for documentation on this specific topic and found only mixed information.

So, the question is, is it possible to use disko to manage the disks for NixOS inside a disk that also has MacOS?

For installing NixOS in a Macbook Pro, you can't wipe the full disk, you will first need to free space from the MacOS installation that you can later, install the system inside. This part is done directly in MacOS via the Asahi script, so that part I obviously don't expect disko to handle.

The question is more about after that part, so, when I boot into the NixOS installer, I will have already the partitions available that I can then format, create sub-volumes (if using btrfs), etc. This part right now I do manually, but I would love to be able to do it with disko so I have a installation that is closer to how it is done in my other machines.

Running lsblk --output KNAME,PATH,LABEL,PARTLABEL,PTTYPE --tree --json, I got this:

{
   "blockdevices": [
      {
         "kname": "nvme0n1",
         "path": "/dev/nvme0n1",
         "label": null,
         "partlabel": null,
         "pttype": "gpt",
         "fstype": null,
         "size": "233.8G",
         "uuid": null,
         "children": [
            {
               "kname": "nvme0n1p1",
               "path": "/dev/nvme0n1p1",
               "label": null,
               "partlabel": "iBootSystemContainer",
               "pttype": "gpt",
               "fstype": "apfs",
               "size": "500M",
               "uuid": "9362fb83-a489-4ebf-8f54-918031fddce0"
            },{
               "kname": "nvme0n1p2",
               "path": "/dev/nvme0n1p2",
               "label": null,
               "partlabel": "Container",
               "pttype": "gpt",
               "fstype": "apfs",
               "size": "78.2G",
               "uuid": "2dd7f090-0814-46f4-b603-7dacfe0293f4"
            },{
               "kname": "nvme0n1p3",
               "path": "/dev/nvme0n1p3",
               "label": null,
               "partlabel": null,
               "pttype": "gpt",
               "fstype": "apfs",
               "size": "2.3G",
               "uuid": "5ec6396a-8db9-4532-b7ea-2476639d067c"
            },{
               "kname": "nvme0n1p4",
               "path": "/dev/nvme0n1p4",
               "label": "EFI - NIXOS",
               "partlabel": null,
               "pttype": "gpt",
               "fstype": "vfat",
               "size": "477M",
               "uuid": "78ED-17F1"
            },{
               "kname": "nvme0n1p5",
               "path": "/dev/nvme0n1p5",
               "label": "nixos",
               "partlabel": null,
               "pttype": "gpt",
               "fstype": "ext4",
               "size": "71.8G",
               "uuid": "46b683e5-e54e-4d9e-b13d-dfb41e5ff2a1"
            },{
               "kname": "nvme0n1p6",
               "path": "/dev/nvme0n1p6",
               "label": null,
               "partlabel": "RecoveryOSContainer",
               "pttype": "gpt",
               "fstype": "apfs",
               "size": "5G",
               "uuid": "c7367236-5629-4811-b689-03c37f9eb961"
            }
         ]
      }
   ]
}

As you can see, nvme0n1 is the SSD used.

/dev/nvme0n1p1, /dev/nvme0n1p2 and /dev/nvme0n1p6 Are MacOS partitions.

/dev/nmve0n1p3 is an APFS partition created by Asahi which I believe that is needed to boot.

/dev/nvme0n1p4 is the NixOS EFI boot partition and /dev/nvme0n1p5 is the NixOS root partition.

What I want to do is a disko config that would format and use /dev/nvme0n1p4 and /dev/nvme0n1p5 for the NixOS installation, but leave the other partitions alone so it doesn't wipe the whole disk or format the MacOS partitions bricking the device.

Is that possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions