-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/activation: improve preSwitchChecks
A couple of improvements: 1. Avoid the generally discouraged apply argument to options, as it has quite weird semantics 2. Avoid issues when a user calls a preSwitchCheck `script`, which would've been silently overridden by the existing implementation. Reliance on a special attribute name like that is bound to lead to a very-hard-to-debug problem for someone at some point 3. Use writeShellApplication so that the preSwitchChecks are checked by shellcheck and and so that they run with basic bash guardrails 4. Fix shellcheck issue (testing the value of $?) 5. Add a positive preSwitchCheck to the nixos test, to make sure that that works as intended
- Loading branch information
Showing
4 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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