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
69 KiB
69 KiB