This repository contains the configuration for a reproducible computer environment using nix-darwin for macOS nix modules. For more information, visit the nix-darwin GitHub repository.
-
Replace the location of the flake:
sed -i '' "s/simple/$(scutil --get LocalHostName)/" flake.nix
-
Determine the correct
hostPlatform
for Mac architecture inflake.nix
:- For Intel Macs:
nixpkgs.hostPlatform = "x86_64-darwin";
- For Apple Silicon Macs:
nixpkgs.hostPlatform = "aarch64-darwin";
- For Intel Macs:
- To search for packages, use https://search.nixos.org/packages
- Add the package to
flake.nix
in theenvironment.systemPackages
list - Run the following command:
darwin-rebuild switch --flake .#MacBook-Pro-Work
To update packages, run the following commands:
nix flake update
darwin-rebuild switch --flake .#MacBook-Pro-Work
To update nix-darwin itself, use these commands:
nix-channel --update darwin
darwin-rebuild changelog
This setup doesn't use nix-homebrew, as it's still an early project.
https://nix-community.github.io/home-manager/#sec-install-nix-darwin-module