justfile test recipe: nixos -> nix

This commit is contained in:
Bryan Ramos 2024-05-13 16:16:47 -04:00
parent 7ba9dc50e7
commit 9f5e4e75b6
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -2,11 +2,11 @@ default:
@just --list @just --list
# Output what derivations will be built # Output what derivations will be built
test TYPE="nixos" SYSTEM="desktop": test TYPE="nix" 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 [ "{{SYSTEM}}" = "desktop" ] || [ "{{SYSTEM}}" = "server" ] || [ "{{SYSTEM}}" = "wsl" ] || [ "{{SYSTEM}}" = "laptop" ]; then if [ "{{SYSTEM}}" = "desktop" ] || [ "{{SYSTEM}}" = "server" ] || [ "{{SYSTEM}}" = "wsl" ] || [ "{{SYSTEM}}" = "laptop" ]; then
echo "Testing NixOS configuration for {{SYSTEM}}..." echo "Testing NixOS configuration for {{SYSTEM}}..."
nix build --dry-run .#nixosConfigurations."{{SYSTEM}}".config.system.build.toplevel -L nix build --dry-run .#nixosConfigurations."{{SYSTEM}}".config.system.build.toplevel -L