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-01-11 03:59: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
machine=$(hostname)
fi
if [[ ! -d "machines/$machine" ]]; then
echo "$machine is not a known machine"
exit
else
echo "Linking ./machines/$machine/configuration.nix to /etc/nixos/configuration.nix"
fi
sudo ln -sf $PWD/machines/$machine/configuration.nix /etc/nixos/configuration.nix