mostly taken from ryan4yin/nix-darwin-kickstarter and torgeir/nix-darwin
Here's a good tutorial on getting started with nix on mac: Setting up Nix on macOS.
- Clone this repo to
~/.config/nix-darwin
. - Install nix:
make install nix
- Install homebrew:
make install homebrew
- Make sure your hostname is set to
huberm
. If not, you'll need to updateflake.nix
with your hostname.
sudo scutil --set HostName huberm && \
sudo scutil --set ComputerName huberm
- Run
make deploy
. Whenever you make changes to your configuration, also run this command to converge the state.
├── flake.lock # a lock file generated by nix, you can ignore it for now
├── flake.nix # the entry point of your nix configuration, you need to add your hostname here
├── modules # a folder contains all your nix-darwin configuration files
│ ├── apps.nix # contains all your homebrew & nix apps(both GUI & CLI)
│ └── system.nix # defines your macOS's system configuration(like dock, trackpad, keyboard, finder, loginwindow, etc.)
└── README.md
-
How do I uninstall? I have not tried it but determinte provides an uninstall script:
/nix/nix-installer uninstall
. -
What if i get an error that the command
darwin-rebuild
is not found? Its unclear to me why determinate sometimes does this but to fix it, runnix-env -iA nixpkgs.darwin-rebuild
before runningmake deploy
the first time.