Files
ubuntu-autoinstaller/init_mystuff.sh
2026-03-07 16:46:26 +01:00

40 lines
906 B
Bash
Executable File

set -ex
_user=alfoldi
_hostname=nokia-l13g4-sisu
_hostname=192.168.1.139
_port=22
# _hostname=localhost
# _port=12222
echo "
Host nokia-sisu
HostName $_hostname
User $_user
Port $_port
" >/tmp/sisu.ssh
function my_rsync() {
rsync -avzP -e "ssh -F /tmp/sisu.ssh" "$@"
}
ssh -qF /tmp/sisu.ssh nokia-sisu "bash -c '
sudo mkdir -p /persists/sops/age/
sudo chown $USER -R /persists/sops/age/
'"
my_rsync --mkpath /persists/sops/age/keys.txt nokia-sisu:/persists/sops/age/
my_rsync ~/.ssh/ nokia-sisu:~/.ssh
ssh -qF /tmp/sisu.ssh nokia-sisu <<'EOF'
mkdir -p ~/workspace/home/nix
cd ~/workspace/home/nix
git clone git@github.com:alfonzso/home-manager.git || true
cd home-manager
sudo bash -c 'echo "trusted-users = root $SUDO_USER" >> /etc/nix/nix.conf'
sudo systemctl restart nix-daemon.service
home-manager --extra-experimental-features 'flakes nix-command' --flake .#nokia switch -b backup
EOF