Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Clarifies
docs/src/how-to/nix-flakes.md: flakes are optional,flake.nixis a new/separate file (not something to paste intoconfiguration.nix), and updates the example flake to actually import the existing./configuration.nixas a module instead of duplicating its settings inline.Why
As reported in #604, a newcomer following this page pasted the
flake.nixsnippet 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.nixdespite 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 showsconfiguration.nixbeing 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
nixavailable in my sandbox to build.#docslocally, 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.