init mystuff

qemu 'network'
template fix
This commit is contained in:
Zsolt Alföldi
2026-03-01 00:17:47 +01:00
parent afed1b36bc
commit 3ffae9e404
3 changed files with 57 additions and 2 deletions

48
init_mystuff.sh Executable file
View File

@@ -0,0 +1,48 @@
set -ex
_user=alfoldi
_hostname=nokia-l13g4-sisu
_port=22
_hostname=localhost
_port=12222
# _ssh=alfoldi@nokia-l13g4-sisu
# _ssh="-e 'ssh -p 12222' alfoldi@localhost"
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 -F /tmp/sisu.ssh nokia-sisu "bash -c '
sudo mkdir -p /persists/sops/age/
sudo chown $USER -R /persists/sops/age/
'"
my_rsync --mkpath ~/.config/sops/age/keys.txt nokia-sisu:/persists/sops/age/
my_rsync ~/.ssh/ nokia-sisu:~/.ssh
# ssh -F /tmp/sisu.ssh nokia-sisu "bash -c '
# mkdir -p ~/workspace/home/nix
# cd ~/workspace/home/nix
# git clone git@github.com:alfonzso/home-manager.git || true
# cd home-manager
# home-manager --extra-experimental-features \'flakes nix-command\' --flake .#nokia build/switch
# '"
ssh -F /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