34 lines
556 B
Bash
Executable file
34 lines
556 B
Bash
Executable file
os="$(uname)"
|
|
other_hostname="$1"
|
|
|
|
case "$os" in
|
|
Darwin)
|
|
nix_hostname="$(scutil --get LocalHostName)"
|
|
config_dir="$HOME/.config/nixpkgs"
|
|
;;
|
|
Linux)
|
|
nix_hostname="$(hostname -s)"
|
|
config_dir="/etc/nixos"
|
|
;;
|
|
*)
|
|
echo "Unsupported OS"
|
|
exit 1
|
|
esac
|
|
|
|
pushd "$config_dir"
|
|
rm -f result
|
|
|
|
if [ -z "$DIRENV_DIR" ]; then
|
|
eval "$(direnv export zsh 2>/dev/null)"
|
|
fi
|
|
|
|
if [ -z "$other_hostname" ]; then
|
|
just deploy-local-machine "$nix_hostname"
|
|
else
|
|
just deploy-remote-machine "$other_hostname"
|
|
fi
|
|
|
|
rm -f result
|
|
popd
|
|
|
|
# vim: ft=sh
|