diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 67b4db0..a8822f3 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -1,8 +1,12 @@ -{{- $git_email := promptStringOnce . "git_email" "Email address for Git" -}} +{{- $git_email := promptStringOnce . "git_email" "Email address for Git" "59441+jehrhardt@users.noreply.github.com"}} +{{- $ssh_key := promptStringOnce . "ssh_key" "SSH key" "~/.ssh/id_ed25519_sk"}} [data.git.user] email = {{ $git_email | quote }} +[data.ssh] + key = {{ $ssh_key | quote }} + [merge] command = "nvim" args = ["-d", "{{ "{{" }} .Destination {{ "}}" }}", "{{ "{{" }} .Source {{ "}}" }}", "{{ "{{" }} .Target {{ "}}" }}"] diff --git a/README.md b/README.md index 76ab6cc..8dba14a 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,12 @@ yay -S atuin chezmoi fish libfido2 starship ttf-firacode-nerd #### SSH key -Generate a new SSH key with Yubikey: +Generate a new SSH key protected by Yubikey: ```bash -# use CapsLock + Space + E shortcut to enter email # use default location for SSH key -# use no passphrase as private key is protected by Yubikey -ssh-keygen -t ed25519-sk -C +# use no passphrase +ssh-keygen -t ed25519-sk -C 59441+jehrhardt@users.noreply.github.com ``` Login to Github and add SSH key for authentication: @@ -48,7 +47,6 @@ gh ssh-key add ~/.ssh/id_ed25519_sk.pub --type signing --title Init and apply chezmoi: ```bash -# when promted for email use CapsLock + Space + E shortcut chezmoi init --ssh --apply jehrhardt ``` diff --git a/dot_config/private_fish/config.fish.tmpl b/dot_config/private_fish/config.fish.tmpl index 546cbaf..c7905c8 100644 --- a/dot_config/private_fish/config.fish.tmpl +++ b/dot_config/private_fish/config.fish.tmpl @@ -8,5 +8,5 @@ if status is-interactive zoxide init fish | source chezmoi completion fish | source starship init fish | source - {{ if eq .chezmoi.os "linux" }}keychain --quiet --eval ~/.ssh/id_ed25519_sk | source{{ end }} + {{ if eq .chezmoi.os "linux" }}keychain --quiet --eval {{ .ssh.key }} | source{{ end }} end diff --git a/dot_gitconfig.tmpl b/dot_gitconfig.tmpl index 7a8cb75..62032c2 100644 --- a/dot_gitconfig.tmpl +++ b/dot_gitconfig.tmpl @@ -10,7 +10,7 @@ [user] name = Jan Ehrhardt email = {{ .git.user.email }} - signingkey = ~/.ssh/id_ed25519_sk + signingkey = {{ .ssh.key }} [commit] gpgsign = true [gpg]