Personal Nix configuration for macOS (nix-darwin), NixOS, and standalone home-manager.
| Host | Platform | Type | Purpose |
|---|---|---|---|
| manson | macOS (aarch64-darwin) | darwin | Development workstation |
| shisui | NixOS (x86_64-linux) | nixos | Headless server (laptop, ISO install) |
| itachi | NixOS (x86_64-linux) | nixos | VPS on OVH (nixos-anywhere) |
# macOS
darwin-rebuild switch --flake ~/.config/nix
# NixOS (on shisui — local)
sudo nixos-rebuild switch --flake ~/.config/nix#shisui
# NixOS (on itachi — remote from macOS)
nix run nixpkgs#nixos-rebuild -- switch \
--flake ~/.config/nix#itachi \
--target-host root@<itachi-ip> \
--build-host root@<itachi-ip>
# Update all inputs
nix flake update
# Garbage collection
nix-collect-garbage -d~/.config/nix/
├── flake.nix
├── flake.lock
│
├── hosts/
│ ├── darwin/ # macOS hosts
│ │ └── manson.nix
│ ├── nixos/ # NixOS hosts
│ │ ├── shisui/
│ │ │ ├── default.nix
│ │ │ └── hardware-configuration.nix
│ │ └── itachi/
│ │ ├── default.nix
│ │ ├── disko.nix
│ │ └── hardware-configuration.nix
│ └── generic/ # Standalone home-manager (VPS)
│
├── modules/
│ ├── darwin/ # macOS system modules
│ ├── nixos/ # Base NixOS modules
│ ├── services/ # Optional services (per-host)
│ │ ├── caddy.nix
│ │ ├── nextcloud.nix
│ │ └── tailscale.nix
│ ├── profiles/
│ │ └── hardware/
│ │ └── laptop.nix # Hardware-specific config
│ ├── home/ # Home-manager modules
│ │ ├── darwin/ # macOS user environment
│ │ ├── nixos/ # NixOS user environment
│ │ └── shared/ # Cross-platform (git, neovim)
│ └── shared/ # Cross-platform system (sops)
│
├── templates/ # devenv templates
├── secrets/ # Encrypted secrets (sops)
└── docs/ # Documentation
NixOS:
# hosts/nixos/my-server/default.nix
{ ... }:
{
imports = [
./hardware-configuration.nix
../../../modules/nixos # Base
../../../modules/profiles/hardware/server.nix
../../../modules/services/tailscale.nix # Pick services
];
networking.hostName = "my-server";
}Generic (Ubuntu VPS):
# hosts/generic/my-vps.nix
{ ... }:
{
imports = [
../../modules/home/shared/git.nix
../../modules/home/shared/astronvim.nix
];
home.username = "deploy";
home.homeDirectory = "/home/deploy";
}Uses devenv for project-local environments.
nix flake init -t ~/.config/nix#python
devenv shellAvailable: python, node, rust, bun, php, golang
| Starting State | Method | Example |
|---|---|---|
| Any Linux with SSH (Ubuntu, Debian, rescue mode) | nixos-anywhere | itachi (OVH VPS) |
| Windows | Bootable ISO (USB) | — |
| Empty / no OS | Bootable ISO (USB) | shisui (laptop) |
| VPS with provider rescue mode | nixos-anywhere | itachi (OVH VPS) |
nixos-anywhere requires SSH access to a running Linux. It kexec's into a NixOS installer in RAM, wipes the disk, and installs your flake config remotely. No physical access needed.
Bootable ISO is the only option when there's no SSH-capable OS on the machine (Windows, empty disk). You flash the NixOS ISO to a USB, boot from it, and install manually.
After initial install, both methods result in the same thing — a NixOS system manageable via nixos-rebuild.