diff --git a/.zshrc b/.zshrc index 5effc0a..30f6495 100755 --- a/.zshrc +++ b/.zshrc @@ -80,6 +80,12 @@ if [ -t 1 ]; then alias ls='l' fi +# Alias for ssh.exe and ssh-add.exe on Windows WSL (microsoft-standard-WSL2) +if [[ $(uname -a) == *"microsoft-standard-WSL2"* ]]; then + alias ssh='ssh.exe' + alias ssh-add='ssh-add.exe' +fi + ###################### # Export Definitions # ###################### diff --git a/bin/actions/update.sh b/bin/actions/update.sh index da7c44e..8bf251f 100755 --- a/bin/actions/update.sh +++ b/bin/actions/update.sh @@ -35,7 +35,12 @@ ensure_symlink() { # Fetch source from YAML based on OS if [[ "$OSTYPE" == "linux-gnu"* ]]; then - source=$(shyaml get-value "config.symlinks.$1.sources.linux" < "$HOME/dotfiles/config/config.yaml") 2>/dev/null + # Check for WSL2 + if [[ $(uname -a) == *"microsoft-standard-WSL2"* ]]; then + source=$(shyaml get-value "config.symlinks.$1.sources.wsl" < "$HOME/dotfiles/config/config.yaml") 2>/dev/null + else + source=$(shyaml get-value "config.symlinks.$1.sources.linux" < "$HOME/dotfiles/config/config.yaml") 2>/dev/null + fi elif [[ "$OSTYPE" == "darwin"* ]]; then source=$(shyaml get-value "config.symlinks.$1.sources.macos" < "$HOME/dotfiles/config/config.yaml") 2>/dev/null fi diff --git a/config/config.yaml b/config/config.yaml index d2a18cf..39bff68 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -6,6 +6,7 @@ config: sources: macos: ~/dotfiles/config/gitconfig.macos linux: ~/dotfiles/config/gitconfig.linux + wsl: ~/dotfiles/config/gitconfig.wsl target: ~/.gitconfig # SSH config diff --git a/config/gitconfig.wsl b/config/gitconfig.wsl new file mode 100644 index 0000000..9bce09c --- /dev/null +++ b/config/gitconfig.wsl @@ -0,0 +1,31 @@ +[user] + signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr + email = menno@vleeuwen.me + name = Menno van Leeuwen + +[gpg] + format = ssh + +[gpg "ssh"] + program = "/mnt/c/Users/menno/AppData/Local/1Password/app/8/op-ssh-sign-wsl" + +[commit] + gpgsign = true + +[color] + ui = true +[push] + autoSetupRemote = true +[pull] + rebase = false +[filter "lfs"] + process = git-lfs filter-process + required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f +[core] + sshCommand = ssh.exe +[url "ssh://git@"] + insteadOf = https:// +[safe] + directory = *