diff --git a/justfile b/justfile index 630d03a..6f67c03 100644 --- a/justfile +++ b/justfile @@ -20,7 +20,7 @@ clean: echo "All clean!" # Output what derivations will be built -test TYPE SYSTEM="desktop": +out TYPE SYSTEM="desktop": #!/usr/bin/env bash set -euo pipefail case "{{TYPE}}" in @@ -60,6 +60,47 @@ test TYPE SYSTEM="desktop": ;; 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 make TYPE SYSTEM="desktop": #!/usr/bin/env bash