Skip to content

Don't run preSwitchChecks during install#447

Merged
Mic92 merged 1 commit intomainfrom
phaer-no-pre-switch-checks
Feb 24, 2025
Merged

Don't run preSwitchChecks during install#447
Mic92 merged 1 commit intomainfrom
phaer-no-pre-switch-checks

Conversation

@phaer
Copy link
Copy Markdown
Member

@phaer phaer commented Jan 7, 2025

NixOS includes an option called system.preSwitchChecks since NixOS/nixpkgs@6e192c4.

As we are installing a new system here, we do not care too much about the systems state pre switching and therefore disable those checks.

This change is motivated by nix-community/srvos#591 (comment)

untested, but this might help @Kranzes?

NixOS includes an option called `system.preSwitchChecks` since
NixOS/nixpkgs@6e192c4.

As we are installing a new system here, we do not care too much about the systems state pre-switching and therefore disable those checks. 

This change is motivated by nix-community/srvos#591 (comment)
@Kranzes
Copy link
Copy Markdown
Member

Kranzes commented Jan 7, 2025

I'd rather the workaround be done on the SrvOS side of things, if possible. Unless you think there will be more cases besides SrvOS for this?

@phaer
Copy link
Copy Markdown
Member Author

phaer commented Jan 7, 2025

Happy about alternative PRs! If you want to convince me, I'd need more of an argument as to why you think so.

Srvos already ships two mechanism by which to skip this check.

EXPECTED_HOSTNAME, which requires the target hostname that we don't have readily available.
And NIXOS_NO_CHECK which is used here as I couldn't come up with a preSwitchCheck that you would want to run during first install.

@phaer phaer marked this pull request as ready for review January 7, 2025 13:23
@Kranzes
Copy link
Copy Markdown
Member

Kranzes commented Jan 7, 2025

If you want to convince me, I'd need more of an argument as to why you think so.

You won. I don't have the energy LOL. I will test this PR later.

@zowoq
Copy link
Copy Markdown
Contributor

zowoq commented Jan 19, 2025

PR to improve installer detection: nix-community/srvos#601.

Probably a good idea to merge this PR anyway.

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Feb 7, 2025

@phaer do you still think this PR is needed?

@phaer
Copy link
Copy Markdown
Member Author

phaer commented Feb 7, 2025

@Mic92 "needed" might be a too strong word. Still think it's probably closer to what users wants and therefore useful, no?

Alternatively could try to fix that upstream

@Mic92 Mic92 added this pull request to the merge queue Feb 24, 2025
Merged via the queue into main with commit 711c816 Feb 24, 2025
@Mic92 Mic92 deleted the phaer-no-pre-switch-checks branch February 24, 2025 07: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.

4 participants