MatthewCroughan / NixThePlanet

Run macOS, Windows and more via a single Nix command, or simple nixosModules
MIT License
534 stars 12 forks source link

increase macos default disk size #17

Closed brainrake closed 6 months ago

brainrake commented 6 months ago

There is not enough free disk space (17G vs required 21G) to install Command Line Tools, which are often required by development tools. This PR increases the default macos disk size from 50Gb to 100Gb.

MatthewCroughan commented 6 months ago

That is not how image builders generally work. The goal of the makeDarwinImage is to make as small an image as possible, which can later be extended. You can already increase the disk size yourself manually, by copying the base image to a local directory and then running all of the operations (qemu-img resize, and expansion in the guest). To do this declaratively is already in the TODO https://github.com/MatthewCroughan/NixThePlanet?tab=readme-ov-file#todo, but I've been looking for funding to help me move towards this.

The way it would work is that makeDarwinImage would produce two derivations:

  1. The original 50GB disk image
  2. A disk image of declarative size

The second derivation would be constructed by expanding the qemu qcow2 of the original image, booting the machine in qemu, then using SSH to expand the macOS machine from inside, and then taking another snapshot. This means you don't have to wait another hour to increase the disk size like you've suggested in this PR, and keeps the original base image small.