Bootstrapping
The Bootstrap Command
Section titled “The Bootstrap Command”You can create a flake.nix from scratch — without running inside an existing flake — using a one-shot bootstrap command:
# Write a minimal bootstrap moduleecho '{ flake-file.inputs.flake-file.url = "github:vic/flake-file"; }' > bootstrap.nix
# Generate flake.nixnix-shell https://github.com/vic/flake-file/archive/refs/heads/main.zip \ -A flake-file.sh \ --run write-flake \ --arg modules ./bootstrap.nixReplace write-flake with write-inputs, write-unflake, or write-npins to target a different backend.
Using a modules directory
Section titled “Using a modules directory”bootstrap.nix can also be a directory. All .nix files in it will be auto-imported:
nix-shell https://github.com/vic/flake-file/archive/refs/heads/main.zip \ -A flake-file.sh \ --run write-flake \ --arg modules ./modulesThis is useful when you already have module files and just need the initial flake.nix to be generated before Nix can evaluate the flake itself.
Next Steps
Section titled “Next Steps”After generating flake.nix, continue with the standard Quick Start flow.