These are my personal nix-dotfiles to setup my macOS machines. Use at your own risk.
It's still very much work in progress.
-
Install nix on your machine.
-
The first build which will also setup nix-darwin needs to be made manually:
nix --extra-experimental-features nix-command \
--extra-experimental-features flakes \
run nix-darwin -- switch --flake "$HOME/dotfiles?submodules=1#m1"
Consecutive runs can be done via
darwin-rebuild switch --flake "$HOME/dotfiles?submodules=1#m1"
Neovim configuration is currently pulled in via git submodule.
Additional sensitive information are encrypted with git-crypt.
These live under the folder machines
and get included inside flake.nix.
To create your own you can use this example code as a start for a personal.nix
:
{ config, pkgs, ... }: {
# enable git and add email and gpg-key to the rest of the config
programs.git = {
enable = true;
userEmail = "[email protected]";
signing.key = "your-key-id";
};
# install a list of additional packages
home.packages = with pkgs; [
foo-package
];
# add multiline information to hosts file
home.file.".ssh/hosts".text = ''
Host example-host
Hostname 127.0.0.1
User foo
'';
}
- handling secrets → git-crypt
- machine specific configuration
- properly registering gui apps → homebrew until nix takes over
- setup nix-darwin to add more darwin specific configuration
- setup flakes
Feel free to open issues if you’re interested in something.
Consider dotfiles unlicensed (https://unlicense.org/), do what you want with anything you want. Feel free to link back if you want, it could help others in the future but I don’t mind otherwise.