8000 Headless mode by figsoda · Pull Request #665 · nix-community/nix-init · GitHub
[go: up one dir, main page]

Skip to content
8000

Headless mode - #665

Merged
figsoda merged 4 commits into
mainfrom
headless
Jan 10, 2026
Merged

figsoda merged 4 commits into
mainfrom
headless

Conversation

@figsoda
@figsoda figsoda commented Dec 31, 2025 •
Copy link
Copy Markdown
Member

Thank you @dhnaranjo for working on #649. This pull request is built on top of that, and these are the few major differences

  • all the new flags work in interactive mode too, headless mode simply skips all the prompts
  • the defaults for headless mode are more similar to the interactive mode
    • doesn't fail when there is something like a missing rev, the meta output and boilerplate should still be useful even if the repo is not fetched at all
    • fetch submodules by default if the repo has submodules
    • unlike the interactive mode, it doesn't overwrite by default similar to feat: Headless CLI use #649
  • --builder expects arguments like buildGoModule rather than go-mod, so the options are more predictable if you are already familiar with nixpkgs
  • --version-name is now named --version, this is so the flags are more predictable. however this changes the behavior of nix-init --version foo from printing the version to specifying version = "foo". nix-init --version without any extra arguments still works as expected
  • all the rustyline stuff are refactored into the new frontend module. this opens up possibilities in the future to implement alternative frontends (json?)

This is not very well tested at the moment as we don't have any end-to-end testing. I will work on more thoroughly testing this in the next few days before I merge this

closes #648

PS: the diff is pretty big, it's probably easier to read commit-by-commit

also renames BuildType -> Builder
- renames RustVendor -> CargoVendor to be consistent with the cli option
- removes the outdated conditional importCargoLock preference, since
  fetchCargoVendor works with git dependencies unlike the old fetchCargoTarball
@figsoda
figsoda merged commit 2d7176e into main Jan 10, 2026
3 checks passed
@figsoda
figsoda deleted the headless branch January 10, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expose all parameters on the cli to allow unattended use

1 participant

0