diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-12-12 00:27:37 +0100 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-12-12 00:27:37 +0100 |
commit | fb581407fe0a996a8619cdbe74cb0dda0dbb8194 (patch) | |
tree | ff3e0e608945b01183b4eb3df34b7464ce7ca647 /build.sh | |
parent | Include hardware config (diff) | |
download | Rory-Open-Architecture-fb581407fe0a996a8619cdbe74cb0dda0dbb8194.tar.xz |
Add wrapper script
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..1fdf453 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh +if [ $# -ne 2 ]; then + echo "Usage: $0 <root> <config>" + echo "NOTE: hardware config will be generated from root!" + echo "Defined configs:" + cat flake.nix | grep 'nixpkgs.lib.nixosSystem' | sed 's/ =.*//' | sed 's/^[ \t]*//;s/[ \t]*$//' | while read cfg; do echo " - $cfg"; done + exit 1 +fi +if [ "$1" = "/" ]; then + nixos-generate-config --show-hardware-config > hardware-configuration.nix + nixos-rebuild --flake ".#${2}" build + exit 1 +else + nixos-generate-config --show-hardware-config > hardware-configuration.nix + nixos-install --root "${1}" --flake ".#${2}" + exit 1 +fi |