added clean recipe

This commit is contained in:
Bryan Ramos 2024-05-13 22:42:59 -04:00
parent 60bf487552
commit d076c79cb9
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -4,6 +4,21 @@ SYSTEM := "$(echo $HOSTNAME)"
default: default:
@just --list @just --list
# Clean up build artifacts
clean:
#!/usr/bin/env bash
set -euo pipefail
echo "Cleaning build artifacts"
if [ -d result ]; then
echo "Removing result directory..."
rm ./result;
fi
if ls *.qcow2 1> /dev/null 2>&1; then
echo "Removing virtual disk..."
rm ./*.qcow2;
fi
echo "All clean!"
# Output what derivations will be built # Output what derivations will be built
test SYSTEM TYPE="nix": test SYSTEM TYPE="nix":
#!/usr/bin/env bash #!/usr/bin/env bash
@ -39,7 +54,7 @@ test SYSTEM TYPE="nix":
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
build SYSTEM TYPE="nix": make SYSTEM TYPE="nix":
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
case "{{TYPE}}" in case "{{TYPE}}" in