Add terraform alias
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{ pkgs, gh, ... }:
|
||||
|
||||
pkgs.writeShellScriptBin "setup-ssh" (builtins.replaceStrings ["gh "] ["${gh}/bin/gh "] (builtins.readFile ./setup-ssh.sh))
|
||||
@@ -0,0 +1,12 @@
|
||||
# vim: set ft=bash:
|
||||
file="${HOME}/.ssh/id_ed25519"
|
||||
if [ ! -f "${file}" ]; then
|
||||
echo "Generating a new key"
|
||||
ssh-keygen -t ed25519 -f "${file}" -N ''
|
||||
cat "${file}.pub" >> /etc/nixos/home/ssh/authorized_keys
|
||||
|
||||
echo "Authing key to GitHub - may fail"
|
||||
gh auth refresh -h github.com -s admin:public_key
|
||||
gh ssh-key add -t ${HOSTNAME}-auto "${file}" || true
|
||||
fi
|
||||
cp /etc/nixos/home/ssh/authorized_keys "${HOME}/.ssh/authorized_keys"
|
||||
Reference in New Issue
Block a user