auto: bootstrapping sparky

This commit is contained in:
Sam 2024-05-26 17:22:20 +01:00
parent d7ce738cd1
commit 3c4e2bd19e
2 changed files with 7 additions and 4 deletions

View File

@ -228,11 +228,11 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1716736919, "lastModified": 1716740534,
"narHash": "sha256-8nez9aHXozu8uJachSETQgsG0fgEqTi3sGeWyfeNBqk=", "narHash": "sha256-dmhiwpEQfk49yYv4q+UrpmH4TQSPzCpzV4635wvO93g=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "8fe58ac9c3ec754bc262b7df375ff0da174bd080", "rev": "204907123c7a9a7dde23200cf9096cb08c7169fb",
"revCount": 50, "revCount": 51,
"type": "git", "type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}, },

View File

@ -42,6 +42,9 @@ ssh-keygen -t ed25519 -f "$temp/persist/etc/ssh/ssh_host_ed25519_key" -C root@"$
chmod 600 "$temp/persist/etc/ssh/ssh_host_ed25519_key" chmod 600 "$temp/persist/etc/ssh/ssh_host_ed25519_key"
chmod 644 "$temp/persist/etc/ssh/ssh_host_ed25519_key.pub" chmod 644 "$temp/persist/etc/ssh/ssh_host_ed25519_key.pub"
echo -e "\nNeed to change ownership of temp directories\n"
sudo chown root:root -R "$temp"
# Generate age key from target host and user public ssh key # Generate age key from target host and user public ssh key
echo "Generating age key from target host and user ssh key" echo "Generating age key from target host and user ssh key"
HOST_AGE_KEY=$(nix-shell -p ssh-to-age --run "cat $temp/persist/etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age") HOST_AGE_KEY=$(nix-shell -p ssh-to-age --run "cat $temp/persist/etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age")