This is the multi-machine configuration for my Darwin (macOS) and Linux systems, managed via Nix Flakes, nix-darwin, and home-manager.
- Git: Required to clone this repository.
- Homebrew (Darwin only): Used for managing some macOS applications.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Nix: Install Nix with Flakes support.
curl -fsSL https://install.determinate.systems/nix | sh -s -- install- Clone this repository into
~/.config/nix:
git clone https://github.com/thekorn/nix-config.git ~/.config/nix
cd ~/.config/nix- Apply the configuration for your host:
For a first-time installation:
nix run nix-darwin -- switch --flake .#<hostname>For subsequent updates:
darwin-rebuild switch --flake .#<hostname>sudo nixos-rebuild switch --flake .#<hostname>To deploy a Linux host remotely from another machine on the network:
nix run .#deploy-thekorn-server
nix run .#deploy-thekorn-server-2
nix run .#deploy-thekorn-vm
nix run .#deploy-thekorn-vm-desktopThis connects to the matching thekorn@<hostname>, builds on the target, and activates the matching NixOS configuration there.
thekorn-macbook(Personal MacBook)thekorn-studio(Personal Mac Studio)BFG-043556(Work Laptop, user:d438477)
thekorn-server(Main server)thekorn-server-2(Second server)thekorn-vm(VM)thekorn-vm-desktop(Desktop VM)
- Format code:
nix fmt . - Update inputs:
nix flake update
- Idea: move git commit hooks handling to lefthook https://lefthook.dev