justfile update

This commit is contained in:
Bryan Ramos 2024-05-14 14:57:02 -04:00
parent 940c523025
commit d7afba95bf

View file

@ -20,11 +20,11 @@ clean:
echo "All clean!" echo "All clean!"
# Output what derivations will be built # Output what derivations will be built
test SYSTEM TYPE="nixos": test TYPE SYSTEM="desktop":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
case "{{TYPE}}" in case "{{TYPE}}" in
"nixos") "nix")
if if
[ "{{SYSTEM}}" = "desktop" ] || \ [ "{{SYSTEM}}" = "desktop" ] || \
[ "{{SYSTEM}}" = "server" ] || \ [ "{{SYSTEM}}" = "server" ] || \
@ -54,18 +54,18 @@ test SYSTEM TYPE="nixos":
*) *)
echo "Invalid usage: {{TYPE}}."; echo "Invalid usage: {{TYPE}}.";
echo "Use one of:" echo "Use one of:"
echo " nixos" echo " nix"
echo " home" echo " home"
exit 1 exit 1
;; ;;
esac 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 SYSTEM TYPE="nixos": make TYPE SYSTEM="desktop":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
case "{{TYPE}}" in case "{{TYPE}}" in
"nixos") "nix")
if if
[ "{{SYSTEM}}" = "desktop" ] || \ [ "{{SYSTEM}}" = "desktop" ] || \
[ "{{SYSTEM}}" = "server" ] || \ [ "{{SYSTEM}}" = "server" ] || \
@ -93,7 +93,12 @@ make SYSTEM TYPE="nixos":
exit 0 exit 0
;; ;;
"vm") "vm")
if [ "{{SYSTEM}}" = "desktop" ] || [ "{{SYSTEM}}" = "server" ] || [ "{{SYSTEM}}" = "wsl" ] || [ "{{SYSTEM}}" = "laptop" ]; then if
[ "{{SYSTEM}}" = "desktop" ] || \
[ "{{SYSTEM}}" = "server" ] || \
[ "{{SYSTEM}}" = "wsl" ] || \
[ "{{SYSTEM}}" = "laptop" ]
then
echo "Building VM for {{SYSTEM}}..." echo "Building VM for {{SYSTEM}}..."
nixos-rebuild build-vm --flake .#{{SYSTEM}} nixos-rebuild build-vm --flake .#{{SYSTEM}}
result/bin/run-{{SYSTEM}}-vm result/bin/run-{{SYSTEM}}-vm
@ -111,7 +116,7 @@ make SYSTEM TYPE="nixos":
*) *)
echo "Invalid usage: {{TYPE}}." echo "Invalid usage: {{TYPE}}."
echo "Use one of:" echo "Use one of:"
echo " nixos" echo " nix"
echo " home" echo " home"
exit 1 exit 1
;; ;;