added test build just recipe

This commit is contained in:
Bryan Ramos 2024-05-14 21:15:03 -04:00
parent 1900c634ce
commit d773050b00
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -20,7 +20,7 @@ clean:
echo "All clean!" echo "All clean!"
# Output what derivations will be built # Output what derivations will be built
test TYPE SYSTEM="desktop": out TYPE SYSTEM="desktop":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
case "{{TYPE}}" in case "{{TYPE}}" in
@ -60,6 +60,47 @@ test TYPE SYSTEM="desktop":
;; ;;
esac esac
# Test switch into the next generation
test TYPE SYSTEM="desktop":
#!/usr/bin/env bash
set -euo pipefail
case "{{TYPE}}" in
"nix")
if
[ "{{SYSTEM}}" = "desktop" ] || \
[ "{{SYSTEM}}" = "server" ] || \
[ "{{SYSTEM}}" = "wsl" ] || \
[ "{{SYSTEM}}" = "vm" ] || \
[ "{{SYSTEM}}" = "laptop" ]
then
echo "Testing next NixOS generation for {{SYSTEM}}..."
sudo nixos-rebuild test .#{{SYSTEM}}
exit 0
else
echo "Error: Unknown argument - '{{SYSTEM}}'"
echo "Use one of:"
echo " desktop"
echo " server"
echo " laptop"
echo " wsl"
echo " vm"
exit 1
fi
;;
"home")
echo "Testing home configuration..."
nix build --dry-run .#homeConfigurations."workstation".config.home-manager.build.toplevel -L
exit 0
;;
*)
echo "Invalid usage: {{TYPE}}.";
echo "Use one of:"
echo " nix"
echo " home"
exit 1
;;
esac
# Build the nix expression and hydrate the results directory - pass VM flag to build a VM # Build the nix expression and hydrate the results directory - pass VM flag to build a VM
make TYPE SYSTEM="desktop": make TYPE SYSTEM="desktop":
#!/usr/bin/env bash #!/usr/bin/env bash