#!/usr/bin/env bash
set -euxo pipefail

repos=(~/org ~/bin ~/cfg ~/dot-emacs)

echo "pushing lithium"
ssh -qt ben@dev.simatime.com <<'EOF'
repos=(~/org ~/bin ~/cfg ~/dot-emacs)
for r in ${repos[@]}
do
    git -C $r push
done
EOF

echo "pulling"
for r in ${repos[@]}
do
  git -C $r fetch
done

# maybe:
#nix-collect-garbage -d
#nix-channel --update
#NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH home-manager switch