dotfiles.nix/install.sh

17 lines
362 B
Bash
Raw Normal View History

2021-01-11 03:59:20 +00:00
#!/usr/bin/env bash
2020-01-01 21:12:08 +00:00
2021-05-05 22:55:20 +00:00
machine=$1
2020-01-01 21:12:08 +00:00
2021-01-11 03:59:20 +00:00
if [[ -z "$machine" ]]; then
2021-05-05 22:55:20 +00:00
machine=$(hostname)
2021-01-11 03:59:20 +00:00
fi
2021-05-05 22:55:20 +00:00
if [[ ! -d "machines/$machine" ]]; then
2021-01-11 03:59:20 +00:00
echo "$machine is not a known machine"
exit
else
2021-05-05 22:55:20 +00:00
echo "Linking ./machines/$machine/configuration.nix to /etc/nixos/configuration.nix"
2021-01-11 03:59:20 +00:00
fi
2021-05-05 22:55:20 +00:00
sudo ln -sf $PWD/machines/$machine/configuration.nix /etc/nixos/configuration.nix