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