This repository contains a collection of NixOS system configurations.
Setup macOS with nix-darwin
- Build the config
nix build ./\#darwinConfigurations.macbook-pro-m2.system
- Switch to the new setup
./result/sw/bin/darwin-rebuild switch --flake ./\#macbook-pro-m2
- Download the Minimal ISO image from the official https://nixos.org/download#nixos-iso e.g. 64-bit ARM
- Create a new VM with UTM and setting the OS to Linux as well as applying the ISO image to boot
- Once the VM is booted, copy the disko config file
curl -o /tmp/disko-config.nix https://raw.githubusercontent.com/skyuplam/nixos-config/main/machines/disko-config-utm.nix
- Run disko to partition, format and mount the disks
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
- Complete the NixOS installation
- Generate initial nixos config
sudo nixos-generate-config --no-filesystems --root /mnt
- Move the disko config to /mnt/etc/nixos
sudo mv /tmp/disko-config.nix /mnt/etc/nixos
- Update the nixos configurations to include the disko module and the disko config
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
./disko-config.nix
];
- Finish the installation and reboot
sudo nixos-install
sudo reboot