From 6211685b7785725f7132aea3284ed232b0120d9c Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 9 Feb 2023 08:59:12 +0000 Subject: [PATCH] Move ssh-config into subdirectory to enable automatic matching --- Makefile | 13 ++++++++----- ssh-config => ssh/config | 0 ssh/config.d/git.conf | 2 ++ ssh/config.d/jet.conf | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) rename ssh-config => ssh/config (100%) create mode 100644 ssh/config.d/git.conf create mode 100644 ssh/config.d/jet.conf diff --git a/Makefile b/Makefile index 41d15fdf..6264c241 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config) FONT_DIR := $(HOME)/.local/share/fonts ZSH_DIR := $(if $(ZSH), $(ZSH), $(HOME)/.oh-my-zsh) ZSH_CUSTOM_DIR := $(if $(ZSH_CUSTOM), $(ZSH_CUSTOM), $(ZSH_DIR)/custom) +SSH_DIR := $(HOME)/.ssh HOME_ITEMS := $(wildcard home/*) HOME_TARGETS := $(HOME_ITEMS:home/%=$(HOME)/.%) @@ -10,6 +11,8 @@ CONFIG_ITEMS := $(wildcard config/*) CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%) ZSH_ITEMS := $(wildcard ohmyzsh/*.zsh) ZSH_TARGETS := $(ZSH_ITEMS:ohmyzsh/%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh) +SSH_ITEMS := $(wildcard ssh/*) +SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%) PACKER_REPO := https://github.com/wbthomason/packer.nvim PACKER_DIR := $(HOME)/.local/share/nvim/site/pack/packer/start/packer.nvim @@ -36,16 +39,16 @@ config: $(CONFIG_TARGETS) zsh: $(ZSH_DIR) $(POWERLEVEL_DIR) $(ZSH_TARGETS) -ssh: $(HOME)/.ssh/config $(HOME)/.ssh/sockets $(HOME)/.ssh/config.d +ssh: $(SSH_TARGETS) $(HOME)/.ssh/sockets nvim: $(PACKER_DIR) $(HOME_TARGETS): $(HOME)/.%: home/% $(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/% $(ZSH_TARGETS): $(ZSH_CUSTOM_DIR)/%.zsh: ohmyzsh/%.zsh -$(HOME)/.ssh/config: $(HOME)/.ssh/%: ssh-% -$(HOME_TARGETS) $(CONFIG_TARGETS) $(ZSH_TARGETS) $(HOME)/.ssh/config: - ln -s $(PWD)/$? $@ +$(SSH_TARGETS): $(SSH_DIR)/%: ssh/% +$(HOME_TARGETS) $(CONFIG_TARGETS) $(ZSH_TARGETS) $(SSH_TARGETS): + ln -s $(PWD)/$? $$(dirname $@) $(PACKER_DIR): git clone --depth 1 $(PACKER_REPO) $@ @@ -56,5 +59,5 @@ $(ZSH_DIR): $(POWERLEVEL_DIR): $(ZSH_DIR) git clone --depth 1 $(POWERLEVEL_REPO) $@ -$(LOCAL_BIN) $(CONFIG_DIR) $(FONT_DIR) $(HOME)/.ssh/sockets $(HOME)/.ssh/config.d: +$(LOCAL_BIN) $(CONFIG_DIR) $(FONT_DIR) $(SSH_DIR) $(HOME)/.ssh/sockets: mkdir -p $@ diff --git a/ssh-config b/ssh/config similarity index 100% rename from ssh-config rename to ssh/config diff --git a/ssh/config.d/git.conf b/ssh/config.d/git.conf new file mode 100644 index 00000000..4a9c7d3e --- /dev/null +++ b/ssh/config.d/git.conf @@ -0,0 +1,2 @@ +Host git.ccfe.ac.uk + user git diff --git a/ssh/config.d/jet.conf b/ssh/config.d/jet.conf new file mode 100644 index 00000000..6d0fa738 --- /dev/null +++ b/ssh/config.d/jet.conf @@ -0,0 +1,14 @@ +Host heimdall + HostName heimdall044.jet.uk + +Host jdc + HostName 10.40.4.103 + +Host freia + HostName freia022.hpc.l + +Host heimdall jdc freia + User elitherl + ForwardX11 yes + ForwardX11Timeout 0 + Compression yes