Add --boot flag to deploy and correct ratchet script #1352
Merged
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.
This is similar to running
nixos-rebuild boot
, just asnixops deploy --test
is similar to runningnixos-rebuild test
. The flag creates anew config and sets it as the default to boot into, but doesn't switch
to it right away.
%s
has no special meaning to echo, so the ratchet script was printingChecking base branch at %s, then PR at %s...\n origin/master d2cb660583ce356af51d9978329c0e77ad284620
.Since we already have
--test
, I figured "why not go for all three major uses?" (the implicit switch, and the explicit--test
and now--boot
).Sometimes I have a config I want to switch into a boot time (because it may be destructive to switch mid-session), so this is the perfect use for it. For example: recently, I was messing with udev rules. Setting
services.udev.extraRules
and switching into this configuration rendered my USB devices (mouse, keyboard) unresponsive until I rebooted. Now, in the future, I know that this is potentially game-over, so I want the change to be available at boot and not switch into it right away.Let me know if I need to do anything else!
P.S. One thing I noticed when running the various CI scripts is that
ci/check-tests.sh
failed to check coverage with the error:nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
. Maybe it's fine (and you just let CI handle it), but it might be nice to have anix-shell
shebang or havepkgs.python3.pkgs.nose
in the shell'sbuildInputs
.EDIT: I imagine ratchet is failing because the new
boot
argument is also of typeAny
(due todef deploy(self, **kwargs: Any) -> None:
). If not (and there's a way I can fix it), let me know.