mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
added vm build script
This commit is contained in:
parent
8a9f41e37e
commit
48f223a030
1 changed files with 18 additions and 2 deletions
20
justfile
20
justfile
|
|
@ -35,7 +35,7 @@ test TYPE="nix" SYSTEM="desktop":
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Build the nix expression and hydrate the results directory
|
# Build the nix expression and hydrate the results directory - pass VM flag to build a VM
|
||||||
build TYPE="nix" SYSTEM="desktop":
|
build TYPE="nix" SYSTEM="desktop":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
@ -60,8 +60,24 @@ build TYPE="nix" SYSTEM="desktop":
|
||||||
nix build --dry-run .#homeConfigurations."workstation".config.home-manager.build.toplevel -L
|
nix build --dry-run .#homeConfigurations."workstation".config.home-manager.build.toplevel -L
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
"vm")
|
||||||
|
if [ "{{SYSTEM}}" = "desktop" ] || [ "{{SYSTEM}}" = "server" ] || [ "{{SYSTEM}}" = "wsl" ] || [ "{{SYSTEM}}" = "laptop" ]; then
|
||||||
|
echo "Building VM for {{SYSTEM}}..."
|
||||||
|
nixos-rebuild build-vm --flake .#{{SYSTEM}}
|
||||||
|
result/bin/run-{{SYSTEM}}-vm
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Error: Unknown argument - '{{SYSTEM}}'"
|
||||||
|
echo "Use one of:"
|
||||||
|
echo " desktop"
|
||||||
|
echo " server"
|
||||||
|
echo " laptop"
|
||||||
|
echo " wsl"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid usage: {{TYPE}}.";
|
echo "Invalid usage: {{TYPE}}."
|
||||||
echo "Use one of:"
|
echo "Use one of:"
|
||||||
echo " nixos"
|
echo " nixos"
|
||||||
echo " home"
|
echo " home"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue