nix-multi

Nix Multi — One foundation for your machines. macOS, NixOS, and virtual machines.

Getting started · Desktop choices · Workflows · Website & documentation · Github

Your machines. Your workflow. One foundation.

An opinionated Nix configuration for macOS, NixOS desktops, and virtual machines. Keep shared tools in reusable modules, personal choices in a profile, and your setup in version control.

A shared foundation Room for your choices
Repeatable environments Flakes pin dependencies; modules capture your configuration.
Personal profiles Identity, locale, hardware, and host preferences stay together.
Multiple platforms nix-darwin for macOS, NixOS for Linux, Home Manager for shared tools.
Optional capabilities Development shells, VM management, Agenix secrets, and AI tooling.

Make it yours before applying it. This repository is actively used on the maintainer’s machines. Replace personal values, hardware settings, SSH hosts, and encrypted secrets before activating a configuration.

Choose your desktop

Each Linux output selects the desktop its name describes:

Flake output Desktop
nixos-end4 Hyprland with the end4 configuration
nixos-omarchy Omarchy desktop through the NixOS integration
nixos-plasma KDE Plasma 6 with SDDM and Plasma Home Manager settings

The Linux setup default is defined near the top of the Makefile:

LINUX_CONFIG ?= nixos-end4 # nixos-end4 | nixos-omarchy | nixos-plasma

Override it for a single invocation after completing setup:

CONFIRM_APPLY=1 make setup-linux LINUX_CONFIG=nixos-plasma

The three maintained desktop outputs share the same host name and hardware profile. The nixos-desktop alias defaults to nixos-omarchy; its selection line in flake.nix also lists all three choices. Older nixos-desktop-end4 and nixos-desktop-omarchy names remain compatibility aliases. nixos-plasma now means Plasma, not end4.

Other maintained output Platform / environment
Ryans-MacBook-Pro Apple Silicon macOS with nix-darwin
vm, nixos-vm-omarchy x86_64 NixOS guest with Omarchy
nixos-vm-hyprland x86_64 NixOS guest with end4 Hyprland
nixos-vm-arm64 ARM64 NixOS guest with end4 Hyprland for UTM

These outputs use the maintainer’s profile. Forks should define their own hosts. The ARM64 and x86_64 VM profiles use separate hardware modules. Generate a fresh module for the architecture and disk layout of the guest you intend to use.

Getting started

  1. Prepare Nix. On macOS, review the Determinate Nix Installer. On NixOS, use the existing installation. Enable nix-command and flakes.
  2. Create a profile. Copy profiles/example.nix to your own profile and set your user name, email, locale, and host preferences.
  3. Describe your hardware. On each NixOS target, run sudo nixos-generate-config --show-hardware-config. Save the output in your own hardware module and update the profile’s hardwareModules paths.
  4. Connect your hosts. Update the profile import and host outputs in flake.nix. Replace the maintainer’s host names, disks, GPU IDs, and SSH configuration. Set machine explicitly when reusing a machine module under a new host name.
  5. Create your secrets. Base secrets.nix on secrets.nix.example, use your own public recipients, and create new encrypted files. See the Agenix guide.
  6. Track and validate. Review and add your configuration files to Git, then run nix flake check and build your selected host before activation.

profiles/local.nix and profiles/local/ are ignored by Git. If you use those paths, explicitly track reviewed configuration with git add -f, or choose another profile name. Never track private keys or plaintext secrets.

After validation, apply your own output with the matching target:

# macOS — replace my-mac with your Darwin output
CONFIRM_APPLY=1 make setup-macos MACOS_CONFIG=my-mac

# NixOS — replace my-desktop with your NixOS output
CONFIRM_APPLY=1 make setup-linux LINUX_CONFIG=my-desktop

Activation installs packages and changes system settings. Keep a known working generation available while trying changes.

Everyday workflows

Command Purpose
make help Discover available commands
make check Evaluate flake checks
make fmt Format Nix files
make dev Enter the default development shell
make dev-web / make dev-python Web or Python development
make dev-flutter / make dev-rust Flutter or Rust development
make vm-download Download the ARM64 UTM ISO without activating a system

Review updates to flake.lock before rebuilding. VM, GPU, and libvirt workflows are host-specific. make clean also runs Nix garbage collection.

Inside the repository

profiles/    Identity, preferences, hardware, and personal imports
machines/    Platform composition for macOS, desktops, and guests
modules/     Reusable system, desktop, host, and VM capabilities
home/        Shared and platform-specific Home Manager configuration
devshells/   Focused development environments
website/     Product website and practical documentation

Explore further

Hardware, BIOS, GPU, and local-model notes contain maintainer-specific examples. Adapt them to your own machine.

Use and licensing

This configuration is provided for educational and personal use. Review the modules before enabling them on a machine you rely on, and check the licenses of included software separately.