init mystuff
qemu 'network' template fix
This commit is contained in:
48
init_mystuff.sh
Executable file
48
init_mystuff.sh
Executable 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
|
||||
4
qemu.sh
4
qemu.sh
@@ -24,4 +24,6 @@ qemu-system-x86_64 \
|
||||
-enable-kvm \
|
||||
-drive file=/tmp/test-disk.qcow2,format=qcow2 \
|
||||
"${_cdrom[@]}" \
|
||||
-bios /usr/share/ovmf/OVMF.fd
|
||||
-bios /usr/share/ovmf/OVMF.fd \
|
||||
-netdev user,id=net0,hostfwd=tcp::12222-:22 \
|
||||
-device e1000,netdev=net0
|
||||
|
||||
@@ -68,10 +68,15 @@ autoinstall:
|
||||
encoding: b64
|
||||
content: "${NOKIA_CLIENT_KEY_B64}"
|
||||
|
||||
- path: /persists/sops/age/.keep
|
||||
permissions: "0600"
|
||||
owner: ${TARGET_USER}:${TARGET_USER}
|
||||
content: ""
|
||||
|
||||
- path: /home/${TARGET_USER}/first_install.sh
|
||||
permissions: "0755"
|
||||
owner: ${TARGET_USER}:${TARGET_USER}
|
||||
# |
|
||||
# | |
|
||||
# envsubst hack \ /
|
||||
# `
|
||||
content: |
|
||||
|
||||
Reference in New Issue
Block a user