Skip to content

only build NixOS if you have the install phase enabled #472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Feb 24, 2025

No description provided.

Gate `nixosSystem` build behind the `installPhase` flag.
This ensures that the `nixosSystem` is only built when really needed by
`nixos-anywhere`.

This is especially useful if `nixpkgs.hostPlatform` is not set yet and
building the derivation would error out.
The build can be split in to phases with `nixos-facter` being run in the
kexec phase.

Potential Drawbacks:

Since the `nixosSystem` is not built early in the invocation we can't
fail fast on errors anymore.
But this is only the case if the phases are already controlled from the
"outside" eg. if `nixos-anywhere` is called without the install phase
active.
@Mic92 Mic92 added this pull request to the merge queue Feb 24, 2025
Merged via the queue into nix-community:main with commit c699182 Feb 24, 2025
3 checks passed
@a-kenji a-kenji deleted the gate-nixos-system branch February 24, 2025 06:09
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