Skip to content

flake/parseFlakeRef: add explicit entryFile parameter#15700

Open
hsjobeki wants to merge 2 commits intoNixOS:masterfrom
hsjobeki:allow-non-flakes
Open

flake/parseFlakeRef: add explicit entryFile parameter#15700
hsjobeki wants to merge 2 commits intoNixOS:masterfrom
hsjobeki:allow-non-flakes

Conversation

@hsjobeki
Copy link
Copy Markdown
Contributor

Motivation (also in commit message)

instead of isFlake, we might want to support explicit entry points, such as "default.nix". Right now the name parseFlakeRef is still coupled to flakes, but could be renamed to parseSourceRef or similar in a later pr. The motivation behind this commit is to decouple nix commands from flakes


Note: This should be equivalent behavior refactoring, just for decoupling and opening the road

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

instead of isFlake, we might want to support explicit entry points, such
as "default.nix". Right now the name parseFlakeRef is still coupled to
flakes, but could be renamed to parseSourceRef or similar in a later pr.
The motivation behind this commit is to decouple nix commands from
flakes
@hsjobeki hsjobeki requested a review from edolstra as a code owner April 16, 2026 16:07
const std::optional<std::filesystem::path> & baseDir = {},
bool allowMissing = false,
bool isFlake = true,
const std::optional<std::string> & entryFile = "flake.nix",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably live in some constant?

@hsjobeki hsjobeki requested a review from xokdvium April 16, 2026 16:09
@hsjobeki hsjobeki force-pushed the allow-non-flakes branch 2 times, most recently from ce3f822 to 3aebaed Compare April 16, 2026 16:14
@edolstra
Copy link
Copy Markdown
Member

I don't think this is a good idea. One of the main goals of flakes was to standardize what a Nix project looks like, i.e. to remove the chaos of having different entry points like default.nix, release.nix etc. You should be able to point commands like nix flake show or nix run at a flake without first having to read the source to figure out what the entry point is.

@hsjobeki
Copy link
Copy Markdown
Contributor Author

I don't think one follows from the other. Allowing a flexible CLI vs flakes adoption. A lot of people don't use flakes and feel treated like second class citizen.
Flakes adoption can be encouraged through docs and examples rather than through an inflexible CLI.

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.

2 participants