docs: update stale dotfiles/nixos flake paths 📝

Stage 4f cleanup. The flake moved from ~/dotfiles/nixos/ to ~/dotfiles/
in 88c5139; docs and install scripts hadn't been refreshed. Point all
rebuild / flake references at the new root:

- AGENTS.md, README.md, server-quickstart.md, docs/server-installer-usb.md,
  docs/sunken-ship-wifi.md, nixos/readme.md — rebuild command paths.
- scripts/nixos-server-install.sh — auto-detect now looks for flake.nix
  at repo root (was nixos/flake.nix).
- scripts/post-install-provision.sh — first-rebuild hint path.

`nixos/hosts/<host>-hardware.nix` and friends stay where they are —
host-specific NixOS modules still live under nixos/; only the flake
entry-points + sops/ + vars/ + lib/ + modules/ + flake-modules/ moved.

nixos/readme.md rewritten to reflect the split (flake at root, per-host
modules under nixos/).
This commit is contained in:
DannyDannyDanny 2026-04-20 20:28:05 +02:00
parent 754cb0d274
commit b0c8664f5c
8 changed files with 36 additions and 29 deletions

View file

@ -1,32 +1,39 @@
# NixOS flake
# NixOS modules
Rebuild from dotfiles dir:
Host-specific NixOS and home-manager modules live under this dir:
- `hosts/<machine>.nix` + `hosts/<machine>-hardware.nix`
- `home/danny/home.nix` (home-manager)
- `fish.nix`, `neovim.nix`, `ollama.nix`, `installer-iso.nix`, `disko-server.nix`
The flake itself (`flake.nix`, `flake.lock`, `flake-modules/`, `lib/`, `modules/`, `sops/`, `vars/`) lives at the **repo root**, not here. See [CLAUDE.md](../CLAUDE.md) at the repo root for rebuild commands, clan.lol operations, and the `dotfiles-rebuild` timer.
## Quick rebuild reference
```bash
# macOS
cd ~/dotfiles/nixos && darwin-rebuild switch --flake .
cd ~/dotfiles && darwin-rebuild switch --flake .
# WSL
sudo nixos-rebuild switch --flake ~/dotfiles/nixos#wsl
sudo nixos-rebuild switch --flake ~/dotfiles#wsl
# sunken-ship (on server)
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship
# Servers (via clan from mac)
nix run git+https://git.clan.lol/clan/clan-core#clan-cli -- \
machines update sunken-ship --flake ~/dotfiles
```
## Server (sunken-ship)
One-time bootstrap (no git until first rebuild):
## Server bootstrap (one-time)
```bash
nix run --extra-experimental-features "nix-command flakes" nixpkgs#git -- clone https://github.com/DannyDannyDanny/dotfiles.git /tmp/dotfiles
nix run --extra-experimental-features "nix-command flakes" nixpkgs#git -- \
clone https://github.com/DannyDannyDanny/dotfiles.git /tmp/dotfiles
sudo mv /tmp/dotfiles /etc/dotfiles
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship --option accept-flake-config true
sudo nixos-rebuild switch --flake /etc/dotfiles#sunken-ship \
--option accept-flake-config true
```
If the daemon doesn't have flakes: copy [server-configuration-with-flakes.nix](server-configuration-with-flakes.nix) to `/etc/nixos/configuration.nix`, run `sudo nixos-rebuild switch`, then build and switch to the flake (see [server-quickstart.md](../server-quickstart.md) for SSH keys).
If the daemon doesn't have flakes: copy [server-configuration-with-flakes.nix](server-configuration-with-flakes.nix) to `/etc/nixos/configuration.nix`, `sudo nixos-rebuild switch`, then build the flake.
SSH keys (not in repo): `scp ~/.ssh/*.pub danny@server:/tmp/`, then on server `mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys`. See [docs/ssh-and-secrets.md](../docs/ssh-and-secrets.md).
Timer: every 15 min the server pulls and rebuilds when `main` changes. Config: `hosts/sunken-ship.nix`, `hosts/sunken-ship-hardware.nix`.
No git in PATH: `sudo nix run nixpkgs#git -- -C /etc/dotfiles pull origin main`.