This is config, it manages my Macbook (Apple silicon) installation, dotfiles and some development packages. It's based on nix-darwin, home-manager and nix-flakes.
This repository keeps a changelog of the most important modifications.
Install nix using the official docs. Git clone the repository, (recommendation is in) .config
, look through, replace usernames / hosts and git email address with your own.
├── configuration.nix
├── darwin # everything related to MacOS
│ ├── brew.nix # brew packages - GUI apps
│ ├── default.nix # system configuration
│ ├── preferences.nix # system preferences
├── home-manager # dotfiles
│ ├── config # all the dotfiles configuration
│ │ ├── alacritty.nix
│ │ ├── git.nix
│ │ ├── starship.nix
│ │ ├── vscode # VSCode configuration
│ │ │ └── default.nix
│ │ └── zsh.nix # zsh configuration
│ └── default.nix
This repository is focused on Macbooks with Apple silicon aarch64-darwin
.
Keep in mind that if you are working with Nix flakes inside of a git repository, nix
considers any modifications which
are not added as "dirty". To fix this, add the items to the staging area, using git add .
before running darwin-rebuild switch
.
This repository is inspired by a lot of folks who have taken time to share their personal Nix configurations and knowledge. In no particular order here are some of them:
- https://github.com/phlmn/nix-darwin-config
- https://github.com/nix-community/home-manager
- https://xyno.space/post/nix-darwin-introduction
- https://determinate.systems
# remove unused references / old-generations
nix-collect-garbage -d
After making changes to the configuration, you need to rebuild the system to apply these changes. There are two ways to do this:
-
Build the configuration:
nix build .#darwinConfigurations.robert.system
-
Switch to the new configuration:
./result/sw/bin/darwin-rebuild switch --flake .#robert
For convenience, a rebuild script is provided that combines the build and switch steps:
-
Ensure the script is executable:
chmod +x rebuild.sh
-
Run the script:
./rebuild.sh
To update Nix to the latest version available in your current Nixpkgs channel:
-
Update your flake inputs:
nix flake update
-
Rebuild your system:
./rebuild.sh
-
Verify the new Nix version:
nix --version
If you want to use a specific version of Nix, modify the darwin/default.nix
file: