only include ssh keys if configured to do so explicitly. use .chezmoiignore to skip linux files on non-linux os

main
Andrew Coleman 2022-08-12 14:05:39 -04:00
parent 8c126dabb3
commit f7a6eb1125
6 changed files with 19 additions and 22 deletions

14
.chezmoiignore Normal file
View File

@ -0,0 +1,14 @@
{{- if ne .include_ssh_keys "true" }}
.config/bash/gitea.sh
.ssh/gitea
.ssh/gitea.pub
.ssh/selfhosted
.ssh/selfhosted.pub
.ssh/github
.ssh/github.pub
{{- end }}
{{- if ne .chezmoi.os "linux" }}
.config/bash/ssh-agent.sh
.config/bash/xhost.sh
.config/systemd/
{{- end }}

View File

@ -1,4 +1,3 @@
{{- if (eq .chezmoi.os "linux") -}}
{{- if (contains "microsoft" .chezmoi.kernel.osrelease) -}}
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@ -11,4 +10,3 @@ fi
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
export SSH_AUTH_SOCK
{{ end }}
{{- end -}}

View File

@ -1,3 +1 @@
{{ if (eq .chezmoi.os "linux" ) }}
xhost +local:root > /dev/null 2>&1
{{ end }}

View File

@ -1,4 +1,3 @@
{{- if (eq .chezmoi.os "linux") -}}
[Unit]
Description=SSH key agent
@ -11,4 +10,3 @@ ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target
{{ end }}

View File

@ -1 +1,3 @@
{{- bitwardenAttachment "selfhosted.pub" "selfhosted-ssh-keys" }}
{{- if ne .include_ssh_keys "true" }}
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3M8FYKBjXXUQpk5+bQXe1zwkONtfbifRnTr+dkNwHt selfhosted@penguincoder.org
{{- end }}

View File

@ -4,7 +4,6 @@ Host *
Host penguincoder.org
Port 2223
User {{ (bitwardenFields "item" "selfhosted-ssh-keys").hydrogen_username.value }}
IdentityFile ~/.ssh/selfhosted
Host git.penguincoder.org
@ -13,16 +12,10 @@ Host git.penguincoder.org
IdentityFile ~/.ssh/gitea
ProxyCommand none
Host helium.penguincoder.org helium
User {{ (bitwardenFields "item" "selfhosted-ssh-keys").hydrogen_username.value }}
Host helium helium.penguincoder.org
HostName 192.168.1.50
Host hydrogen hydrogen.olympus
User {{ (bitwardenFields "item" "selfhosted-ssh-keys").hydrogen_username.value }}
HostName 192.168.1.80
Host potassium potassium.olympus
User {{ (bitwardenFields "item" "selfhosted-ssh-keys").hydrogen_username.value }}
Host potassium potassium.penguincoder.org
HostName 192.168.1.60
ProxyCommand none
@ -33,9 +26,3 @@ Host *.penguincoder.org !git.penguincoder.org
Host github.com
User git
IdentityFile ~/.ssh/github
Host jolijardin.co
User {{ (bitwardenFields "item" "jolijardin.co").username.value }}
PubKeyAuthentication no
# {{ (bitwardenFields "item" "jolijardin.co").password.value }}