2023-03-17 20:08:11 -05:00
|
|
|
# vim: set ft=bash:
|
2023-08-19 01:08:26 +00:00
|
|
|
file="${HOME}/.ssh/id_ed25519"
|
|
|
|
|
if [ ! -f "${file}" ]; then
|
2023-03-17 20:08:11 -05:00
|
|
|
echo "Generating a new key"
|
2023-08-19 01:08:26 +00:00
|
|
|
ssh-keygen -t ed25519 -f "${file}" -N ''
|
|
|
|
|
cat "${file}.pub" >> /etc/nixos/home/ssh/authorized_keys
|
2023-03-17 20:08:11 -05:00
|
|
|
|
|
|
|
|
echo "Authing key to GitHub - may fail"
|
|
|
|
|
gh auth refresh -h github.com -s admin:public_key
|
2024-10-11 12:58:03 -05:00
|
|
|
gh ssh-key add -t "${HOSTNAME}-auto" "${file}" || true
|
2023-03-17 20:08:11 -05:00
|
|
|
fi
|