forked from pub-solar/os
shell: use DEVSHELL_ROOT
This commit is contained in:
parent
b1c42e4ed4
commit
a1fade8411
|
@ -14,21 +14,21 @@ let
|
|||
if [[ -z "$1" ]]; then
|
||||
echo "Usage: $(basename "$0") [ iso | up | install {host} | {host} [switch|boot|test] ]"
|
||||
elif [[ "$1" == "up" ]]; then
|
||||
mkdir -p up
|
||||
mkdir -p $DEVSHELL_ROOT/up
|
||||
hostname=$(hostname)
|
||||
nixos-generate-config --dir up/$hostname
|
||||
nixos-generate-config --dir $DEVSHELL_ROOT/up/$hostname
|
||||
echo \
|
||||
"{
|
||||
imports = [ ../up/$hostname/configuration.nix ];
|
||||
}" > hosts/up-$hostname.nix
|
||||
git add -f up/$hostname
|
||||
git add -f hosts/up-$hostname.nix
|
||||
}" > $DEVSHELL_ROOT/hosts/up-$hostname.nix
|
||||
git add -f $DEVSHELL_ROOT/up/$hostname
|
||||
git add -f $DEVSHELL_ROOT/hosts/up-$hostname.nix
|
||||
elif [[ "$1" == "iso" ]]; then
|
||||
nix build $DEVSHELL_ROOT#nixosConfigurations.niximg.${build}.isoImage "${"\${@:2}"}"
|
||||
elif [[ "$1" == "install" ]]; then
|
||||
sudo nixos-install --flake ".#$2" "${"\${@:3}"}"
|
||||
sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}"
|
||||
else
|
||||
sudo nixos-rebuild --flake ".#$1" "${"\${@:2}"}"
|
||||
sudo nixos-rebuild --flake "$DEVSHELL_ROOT#$1" "${"\${@:2}"}"
|
||||
fi
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue