A comprehensive Nix flake-based configuration for managing multiple systems, including NixOS and macOS (via nix-darwin).
This repository contains a centralized configuration for:
- NixOS systems (desktop, laptop, servers, VM)
- macOS systems (via nix-darwin)
- Home Manager configurations for all systems
- xnix: AMD desktop with NVIDIA GPU
- nixpad: Lenovo ThinkPad T480s
- hetznix: Hetzner cloud server (aarch64)
- vm: VM configuration (aarch64)
- fom-mbp: MacBook Pro (Apple Silicon)
- User environments for all above systems
.
├── bin/ # Helper scripts
├── modules/ # Shared configuration modules
│ ├── nix-settings/ # Common Nix settings
│ ├── system-darwin/ # macOS-specific modules
│ ├── system-nixos/ # NixOS-specific modules
│ └── user/ # User configurations
├── system/ # System-specific configurations
└── flake.nix # Main entry point
# Clone repository
git clone https://github.com/x123/dotfiles.git
cd dotfiles
# Apply system configuration (NixOS or Darwin)
./bin/apply-system $(hostname -s)
# Apply user configuration
./bin/apply-user# Update flake inputs
./bin/update-nix
# Apply changes
./bin/apply-system $(hostname -s)
./bin/apply-user# Deploy to a remote system
./bin/apply-remote-ssh user@host hostname| Script | Description |
|---|---|
apply-system |
Apply NixOS or nix-darwin configuration |
apply-user |
Apply home-manager configuration |
apply-remote-ssh |
Deploy to remote system via SSH |
update-nix |
Update flake inputs |
clean-nix |
Garbage collection and store optimization |
format |
Format code with alejandra |
lint |
Run linters (deadnix, statix, shellcheck) |
build-vm |
Build VM for testing |
store-repair |
Verify and repair Nix store |
macos-post-update |
Post-update tasks for macOS |
- Multi-system management with Nix flakes
- Secret management with sops-nix
- Development environments via
nix develop - Automated formatting and linting via pre-commit hooks
- Disk management with disko
- Hardware-specific configurations via nixos-hardware
A development shell is provided with necessary tools:
nix developThis gives you access to:
- alejandra (formatter)
- deadnix (detects unused variables)
- statix (linter)
- sops (secrets management)
- shellcheck (shell script linter)
- and more
Remote install via nixos-anywhere:
nix run github:nix-community/nixos-anywhere -- --flake .#mininix --target-host root@10.10.10.2