File 'darwin' was not found in the Nix search path

my path appears to be corrupted, and perhaps my entire environment. Is there a backup? A way to restore it?

darwin-rebuild check
building the system configuration…
warning: Nix search path entry ‘/nix/var/nix/profiles/per-user/root/channels’ does not exist, ignoring
error: file ‘darwin’ was not found in the Nix search path (add it using $NIX_PATH or -I)

darwin-rebuild switch --flake ~/nix#[username]

building the system configuration…
error: flake ‘path:/Users/[username]/nix’ does not provide attribute ‘packages.aarch64-darwin.darwinConfigurations.[username].system’, ‘legacyPackages.aarch64-darwin.darwinConfigurations.[username].system’ or ‘darwinConfigurations.[username].system’

In the above, I meant hostname, not username.

That was zsh.

If I run it under bash
bash-5.2$ darwin-rebuild switch --flake ~/nix#[hostname]
building the system configuration…
setting up Homebrew (/opt/homebrew)…
setting up Homebrew (/usr/local)…
user defaults…
restarting Dock…
setting up user launchd services…
Homebrew bundle…
==> Auto-updating Homebrew…
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).
==> Homebrew collects anonymous analytics.
Read the analytics documentation (and how to opt-out) here:
Anonymous Analytics — Homebrew Documentation
No analytics have been recorded yet (nor will be during this brew run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
GitHub - Homebrew/brew: 🍺 The missing package manager for macOS (or Linux)

Error: Unknown command: brew bundle

Digging into the store I see that
ln9nxf2yklrw4mxdy8329inidzx7pyng-etc-100-nix-darwin.conf has 0 bytes.

Is that expected?

nix flake update

This rebuilt my configuration, and I think I can carry on… However, I am still curious why the *darwin.conf file is still empty.