diff options
author | tdro <tdro@users.noreply.github.com> | 2021-11-12 06:13:02 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2021-11-12 22:04:40 -0500 |
commit | d4af9afab1cd2154d0edc924bacbb4e2b91b3839 (patch) | |
tree | c9f11c9f758c59d629c677932f34d831a2a39016 /.local | |
parent | 82d0ac91ab74cdf4ba4384a1752476e973cc5f71 (diff) | |
download | dotfiles-d4af9afab1cd2154d0edc924bacbb4e2b91b3839.tar.gz dotfiles-d4af9afab1cd2154d0edc924bacbb4e2b91b3839.tar.bz2 dotfiles-d4af9afab1cd2154d0edc924bacbb4e2b91b3839.zip |
.local/bin: Add nixos-test
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/nixos-test | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.local/bin/nixos-test b/.local/bin/nixos-test new file mode 100755 index 0000000..aeb2549 --- /dev/null +++ b/.local/bin/nixos-test @@ -0,0 +1,13 @@ +#!/bin/sh -eu + +{ [ "${1:-}" = "-h" ] || + [ "${1:-}" = "--help" ] || + [ "$#" = 0 ]; } && + printf "nixos-test [FILE]...\n" && + exit; + +awk '!s {s=sub("^{$","{ boot.isContainer = true;")}{ print $0 }' "$1" | sponge "$1" + +NIXOS_CONFIG=$(realpath "$1") nixos-rebuild --fast dry-build || true; + +awk '!s {s=sub("{ boot.isContainer = true;","{")}{ print $0 }' "$1" | sponge "$1" |