This repository contains my configuration for my systems, specifically Nix on macOS, a NixOS VM, and my Gaming rig and Server in the future.
.
├── apps # Nix commands used to bootstrap and build configuration
├── configs # Normal .config/ configurations I call inside of Nix
├── hosts # Host-specific configuration
├── modules # macOS and nix-darwin, NixOS, and shared configuration
├── nix-secrets # Secrets handling with agenix
└── overlays # Drop an overlay file in this dir, and it runs. So far, mainly patches.
- Nix Flakes: 100% flake driven, no
configuration.nix
, no Nix channels─ justflake.nix
- Same Environment Everywhere: Easily share config across Linux and macOS (both Nix and Home Manager)
- macOS Setup: Fully declarative macOS w/ UI, dock and macOS App Store apps, homebrew taps, casks, and brews
- Simple Bootstrap: Simple Nix commands to start from zero, both x86 and macOS platforms
- Managed Homebrew: Zero maintenance homebrew environment with
nix-darwin
andnix-homebrew
- Disk Management: Declarative disk management with
disko
, no more disk utils - Secrets Management: Declarative secrets with
agenix
for SSH, PGP, syncthing, and other tools - Built In Home Manager:
home-manager
module for seamless configuration (no extra clunky CLI steps) - Declarative Sync: No-fuss Syncthing: managed keys, certs, and configuration across all platforms
- Simplicity and Readability: Optimized for simplicity and readability in all cases, not small files everywhere
- Backed by Continuous Integration: Flake auto updates weekly if changes don't break starter build
This configuration supports both Intel and Apple Silicon Macs.
Ensure the build works before deploying the configuration, run:
nix run .#build
Note
If you're using a git repository, only files in the working tree will be copied to the Nix Store.
You must run git add .
first.
Warning
You may encounter error: Unexpected files in /etc, aborting activation
if nix-darwin
detects it will overwrite
an existing /etc/
file. The error will list the files like this:
The following files have unrecognized content and would be overwritten:
/etc/nix/nix.conf
/etc/bashrc
Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.
Backup and move the files out of the way and/or edit your Nix configuration before continuing.
Alter your system with this command:
nix run .#build-switch
Caution
~/.zshrc
will be replaced with the zsh
configuration from this repository. Make edits here first if you'd like.
nix run .#build-switch
sudo nixos-rebuild switch --flake .#vm
nix flake update
I have personally tested this configuration on an:
- M1 Apple Silicon Mac
- Bare metal x86_64 PC
- aarch64 NixOS VM inside QEMU on macOS