Update install script, add pine stub

work
mat ess 2021-05-05 17:55:45 -04:00
parent 463759c7ef
commit cbbeb34cc4
2 changed files with 12 additions and 5 deletions

View File

@ -1,16 +1,22 @@
#!/usr/bin/env bash
machine=$1
dest=$1
machine=$HOSTNAME
if [[ -z "$dest" ]]; then
dest="/etc/nixos/configuration.nix"
fi
if [[ -z "$machine" ]]; then
machine=$(hostname)
machine=default-name
fi
if [[ ! -d "machines/$machine" ]]; then
if [[ ! -d "machines/$machine" || ! -f "machines/$machine/configuration.nix" ]]; then
echo "$machine is not a known machine"
echo "Run as \`env HOSTNAME=<MACHINE> ./install.sh\` to override."
exit
else
echo "Linking ./machines/$machine/configuration.nix to /etc/nixos/configuration.nix"
echo "Linking ./machines/$machine/configuration.nix to $dest"
fi
sudo ln -sf $PWD/machines/$machine/configuration.nix /etc/nixos/configuration.nix
sudo ln -sf $PWD/machines/$machine/configuration.nix $dest

View File

@ -0,0 +1 @@
TODO