dotfiles.nix/install.sh

17 lines
362 B
Bash
Executable File

#!/usr/bin/env bash
machine=$1
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