mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
added test build just recipe
This commit is contained in:
parent
1900c634ce
commit
d773050b00
1 changed files with 42 additions and 1 deletions
43
justfile
43
justfile
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue