Skip to content

docs: clarify flakes how-to on flake.nix vs configuration.nix - #1095

Open
yottanami wants to merge 1 commit into
nix-community:mainfrom
yottanami:agent/68-clarify-flakes-doc
Open

yottanami wants to merge 1 commit into
nix-community:mainfrom
yottanami:agent/68-clarify-flakes-doc

Conversation

@yottanami

@yottanami yottanami commented Aug 9, 2026

Copy link
Copy Markdown

What

Clarifies docs/src/how-to/nix-flakes.md: flakes are optional, flake.nix is a new/separate file (not something to paste into configuration.nix), and updates the example flake to actually import the existing ./configuration.nix as a module instead of duplicating its settings inline.

Why

As reported in #604, a newcomer following this page pasted the flake.nix snippet into /etc/nixos/configuration.nix (which errors) because it wasn't clear the two were separate files, or how they relate. You mentioned the page is "admittedly very bare-bones" and welcomed a PR. The old example also didn't actually reference ./configuration.nix despite the intro text saying to add the module "to your nixos configuration in /etc/nixos/configuration.nix", so even a careful reader couldn't see how the pieces fit together. Now the example shows configuration.nix being imported directly, matching how most people actually adopt flakes on an existing install.

How this was tested

Docs-only Markdown change; I don't have nix available in my sandbox to build .#docs locally, so I read the rendered structure by eye (headings, code fence, links). Happy for CI's doc build to confirm.

Closes #604


AI disclosure: This PR (diff, commit message, and this description) was authored by an AI coding agent (Claude). I found no CONTRIBUTING.md or AI-usage policy in this repo to check against.

Users following this page were confused about whether the example
flake.nix belongs in configuration.nix or a separate file (it errors
if pasted into configuration.nix), and how the two files relate.

Explain that flake.nix is a new, separate file, note flakes are
optional, and update the example to actually import the existing
./configuration.nix as a module instead of duplicating its settings
inline, so the two files' relationship is shown rather than implied.

Closes nix-community#604
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.

Documentation on enabling flakes is unclear

1 participant