This repository contains the Nix Flake configuration for macOS using nix-darwin. It provides a declarative and reproducible setup for managing your system and user packages, along with various system configurations.
darwin-configuration.nix
: Defines the system and user packages, system services, and system state versionflake.nix
: Specifies dependencies and defines the darwinConfigurations for nix-darwinhome.nix
: Configuration for home-manager, including user packages and program settings
Here are some of the system packages installed:
- Alacritty config
- Aspell for English Language in Emacs
- Python packages for LSP and Emacs
- Fonts (Fira Mono, Font Awesome, etc.)
Nix Darwin allows you to set system preferences in the configuration file. For example the dock. keyboard mapping and more.
For example:
defaults = {
dock = {
autohide = true;
show-recents = true;
launchanim = true;
mouse-over-hilite-stack = true;
orientation = "bottom";
tilesize = 43;
largesize = 64;
};
- Yabai: For window tiling
- ZSH: Configured with completion and aliases
- skhd: for custom keyboard commands linked to Yabai
- Caps Lock remapped to Control
- Other key mappings crucial for comfortable tiling
- Lock Screen
- Quickly open applications like Alacritty (cmd + return)
To use this configuration, follow these steps:
- Clone this repository
- Modify
darwin-configuration.nix
,flake.nix
, andhome.nix
to suit your preferences (don’t forget the usernames) - Set your system architecture in
flake.nix
- Update
users.users."<your-username>".home
inflake.nix
to match your home directory - Install Nix if not already installed
- Use the
build
command (after editing the location):nix run nix-darwin -- switch --flake ~/git/nix-darwin/.
- Make sure the stateVersion in
darwin-configuration.nix
matches your setup
Feel free to reach out if you have any questions or need further assistance.