{{- $bwAuthenticated = eq (fromJson (output "bw" "status")).status "authenticated" }} {{- if $bwAuthenticated -}} {{- (bitwarden "item" "dev.betelgeuse.ssh.personal.id_rsa.private").notes -}} {{- else -}} {{- $sshLocation = (joinPath .chezmoi.homeDir ".ssh" "id_rsa") -}} {{- if not (stat $sshLocation) -}} {{- $sshKeygen = (output "ssh-keygen" "-b" "4096" "-t" "rsa" "-f" $sshLocation "-q" "-N" }} {{- end -}} {{- include $sshLocation }} {{ end }}