Update install script, add pine stub
parent
463759c7ef
commit
cbbeb34cc4
16
install.sh
16
install.sh
|
@ -1,16 +1,22 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
machine=$1
|
dest=$1
|
||||||
|
machine=$HOSTNAME
|
||||||
|
|
||||||
|
if [[ -z "$dest" ]]; then
|
||||||
|
dest="/etc/nixos/configuration.nix"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "$machine" ]]; then
|
if [[ -z "$machine" ]]; then
|
||||||
machine=$(hostname)
|
machine=default-name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d "machines/$machine" ]]; then
|
if [[ ! -d "machines/$machine" || ! -f "machines/$machine/configuration.nix" ]]; then
|
||||||
echo "$machine is not a known machine"
|
echo "$machine is not a known machine"
|
||||||
|
echo "Run as \`env HOSTNAME=<MACHINE> ./install.sh\` to override."
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
echo "Linking ./machines/$machine/configuration.nix to /etc/nixos/configuration.nix"
|
echo "Linking ./machines/$machine/configuration.nix to $dest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo ln -sf $PWD/machines/$machine/configuration.nix /etc/nixos/configuration.nix
|
sudo ln -sf $PWD/machines/$machine/configuration.nix $dest
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
TODO
|
Loading…
Reference in New Issue