From 14f0cc458a879569ad27b3431894cf8efd7c273d Mon Sep 17 00:00:00 2001 From: shokinn Date: Fri, 13 Dec 2024 16:44:14 +0100 Subject: [PATCH] add meta and os profiles; add distro and vw variable --- config.yaml | 223 ++++++++++---------------------------------- dotfiles/commonfunc | 4 +- dotfiles/ssh/config | 2 +- dotfiles/z_profile | 8 +- dotfiles/zshenv | 6 +- dotfiles/zshrc | 8 +- 6 files changed, 63 insertions(+), 188 deletions(-) diff --git a/config.yaml b/config.yaml index 24197c3..53c01b9 100644 --- a/config.yaml +++ b/config.yaml @@ -143,194 +143,69 @@ dotfiles: dst: ~/.ssh/config chmod: '600' profiles: - AINCRAD: + meta_base: + variables: + linux: false + vw: false + wsl: false dotfiles: - - d_fonts - - f_profile - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - d_colors - - f_compton.conf - - f_rofi_config - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile - - f_start_systemd_shell.sh - - f_wsladdhypervroute - - f_wslenablehypervforwarding - - f_wslshowhypervforwarding - - f_config - AINCRAD-wsl: - dotfiles: - - d_fonts - - f_profile - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - - d_colors - - f_compton.conf - - f_rofi_config - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile - - f_start_systemd_shell.sh - - f_wsladdhypervroute - - f_wslenablehypervforwarding - - f_wslshowhypervforwarding - - f_config - sbx0nucmac01.home.pphg.tech: - dotfiles: - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - - d_colors - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile + - f_agenix_helper - f_commonfunc - f_config - susanoo.local: - dotfiles: - - f_vimrc - - f_zshrc - - f_zshenv - f_powerlevel10krc - - d_colors - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile - f_rmquarantine - - f_commonfunc - f_secretfiles - - f_agenix_helper - - f_config - yoetunheimr: - dotfiles: - - d_bspwm - - d_polybar - - d_sxhkd - - f_fehbg - - d_fonts - - f_profile - f_vimrc - - f_xinitrc - - f_xsession - f_zprofile - - f_zshrc - f_zshenv - - f_powerlevel10krc - - d_colors - - f_xresources - - f_ssh-agent.service - - f_compton.conf - - f_rofi_config - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_wsladdhypervroute - - f_wslenablehypervforwarding - - f_wslshowhypervforwarding - - f_config - YOETUNHEIMR-wsl: + - f_zshrc + meta_linux: + variables: + linux: true dotfiles: - d_fonts - f_profile - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - - d_colors - - f_compton.conf - - f_rofi_config - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile - - f_start_systemd_shell.sh - - f_wsladdhypervroute - - f_wslenablehypervforwarding - - f_wslshowhypervforwarding - - f_config - ymir: + meta_vw: + variables: + vw: true dotfiles: - - f_zshrc - - f_zshenv - - f_zprofile - - d_fonts - - f_profile - - f_vimrc - - f_powerlevel10krc - - d_colors - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_wsladdhypervroute - - f_wslenablehypervforwarding - - f_wslshowhypervforwarding - - f_commonfunc - - f_gpgagent - - f_secretfiles - - f_agenix_helper - - f_config - workspace: - dotfiles: - - d_fonts - - f_profile - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - - d_colors - - f_zprofile - - f_commonfunc - - f_config - WVDEWOBMC001307: - dotfiles: - - f_vimrc - - f_zshrc - - f_zshenv - - f_powerlevel10krc - - d_colors - - f_c3cp - - f_mount_c3voc - - f_c3l - - f_c3kdenlive - - f_c3mpv - - f_c3check - - f_zprofile - f_pu - f_rpki + meta_wsl: + variables: + wsl: true + dotfiles: + - f_wsladdhypervroute + - f_wslenablehypervforwarding + - f_wslshowhypervforwarding + os_macos: + variables: + distro: macos + include: + - meta_base + dotfiles: - f_rmquarantine - - f_commonfunc - - f_secretfiles - - f_agenix_helper - - f_config + os_ubuntu: + variables: + distro: ubuntu + include: + - meta_base + - meta_linux + sbx0nucmac01.home.pphg.tech: + include: + - os_macos + susanoo.local: + include: + - os_macos + workspace: + include: + - os_ubuntu + WVDEWOBMC001307: + include: + - os_macos + - meta_vw + WVDEWOBMC002277: + include: + - os_macos + - meta_vw diff --git a/dotfiles/commonfunc b/dotfiles/commonfunc index 1d90015..849faec 100644 --- a/dotfiles/commonfunc +++ b/dotfiles/commonfunc @@ -124,7 +124,7 @@ EOF fi } -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'susanoo.local' @@%} +{%@@ if distro == 'macos' @@%} ####################################### # Shows a netstat -tulpn styled output on mac. # Globals: @@ -351,7 +351,7 @@ dotdrop() { {{@@ env['HOME'] @@}}/.local/bin/dotdrop --cfg={{@@ env['HOME'] @@}}/.files/config.yaml ${@} } -{%@@ endif @@%}{%@@ if profile == 'WVDEWOBMC001307' @@%} +{%@@ endif @@%}{%@@ if vw == true @@%} setProxyEnv() { local HIGHLIGHT='\033[36;1m' local RESET='\033[0;0m' diff --git a/dotfiles/ssh/config b/dotfiles/ssh/config index cb95fbb..8bd29de 100644 --- a/dotfiles/ssh/config +++ b/dotfiles/ssh/config @@ -7,7 +7,7 @@ Include {{@@ env['HOME'] @@}}/.colima/ssh_config Include config.d/*.config Include config.d/*/*.config -{%@@ if profile == 'susanoo.local' or profile == 'WVDEWOBMC001307' @@%}# +{%@@ if distro == 'macos' @@%}# # This have to be LAST # Match host * exec "[[ -z $SSH_CLIENT && -z $SSH_TTY ]]" diff --git a/dotfiles/z_profile b/dotfiles/z_profile index 32729ed..3c42dbd 100644 --- a/dotfiles/z_profile +++ b/dotfiles/z_profile @@ -9,26 +9,26 @@ export VISUAL EDITOR='vim' export EDITOR -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'susanoo.local' @@%} +{%@@ if distro == 'macos' @@%} [[ $(command -v /opt/homebrew/bin/brew) ]] && eval "$(/opt/homebrew/bin/brew shellenv)" # Added by Toolbox App export PATH="$PATH:{{@@ env['HOME'] @@}}/Library/Application Support/JetBrains/Toolbox/scripts" {%@@ endif @@%} -{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' @@%} +{%@@ if linux == true @@%} # Set DOTNET_ROOT enviroment variable DOTNET_ROOT=/opt/dotnet export DOTNET_ROOT {%@@ endif @@%} -{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' or profile == 'ymir' @@%} +{%@@ if linux == true @@%} # Set XDG_CONFIG_HOME XDG_CONFIG_HOME="{{@@ env['HOME'] @@}}/.config" export XDG_CONFIG_HOME {%@@ endif @@%} -{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' or profile == 'ymir' @@%} +{%@@ if wsl == true @@%} # Run VPN-Kit alpine VM to route traffic through Windows and if connected through VPNs wsl.exe -d wsl-vpnkit service wsl-vpnkit start {%@@ endif @@%} diff --git a/dotfiles/zshenv b/dotfiles/zshenv index 19094ec..b78ed80 100644 --- a/dotfiles/zshenv +++ b/dotfiles/zshenv @@ -11,13 +11,13 @@ export ANSIBLE_NOCOWS=1 # Include ~/.local/bin to PATH [[ -d "{{@@ env['HOME'] @@}}/.local/bin" ]] && export PATH="{{@@ env['HOME'] @@}}/.local/bin:${PATH}" -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'susanoo.local' @@%}# Include /opt/homebrew/opt/gnu-getopt/bin to PATH +{%@@ if distro == 'macos' @@%}# Include /opt/homebrew/opt/gnu-getopt/bin to PATH [[ -d "/opt/homebrew/opt/gnu-getopt/bin" ]] && export PATH="/opt/homebrew/opt/gnu-getopt/bin:${PATH}" {%@@ endif @@%}# Include $(go env GOPATH) to PATH [[ $(command -v go) ]] && [[ -d "$(go env GOPATH)/bin" ]] && export PATH="$(go env GOPATH)/bin:${PATH}" -{%@@ if profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'yoetunheimr' or profile == 'ymir' @@%} +{%@@ if wsl == true @@%} # Connect to windows ssh pageant # https://github.com/BlackReloaded/wsl2-ssh-pageant export SSH_AUTH_SOCK={{@@ env['HOME'] @@}}/.ssh/agent.sock @@ -43,7 +43,7 @@ export GPG_TTY=$(tty) # X410 (Windows X11 Server) export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 {%@@ endif @@%} -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'susanoo.local' @@%} +{%@@ if distro == 'macos' @@%} export HOMEBREW_CASK_OPTS="--appdir=~/Applications" {%@@ endif @@%} diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 9ebb74e..26608b1 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -105,11 +105,11 @@ plugins=( vscode zsh-navigation-tools zsh-ssh -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'ymir' or profile == 'susanoo.local' @@%} # Mac specifics +{%@@ if distro == 'macos' @@%} # Mac specifics brew iterm2 macos -{%@@ endif @@%}{%@@ if profile == 'yoetunheimr' or profile == 'AINCRAD-wsl' or profile == 'AINCRAD' or profile == 'YOETUNHEIMR-wsl' or profile == 'ymir' @@%} # Archlinux specifics +{%@@ endif @@%}{%@@ if distro == 'arch' @@%} # Archlinux specifics archlinux {%@@ endif @@%} ) @@ -157,7 +157,7 @@ source ${ZSH}/oh-my-zsh.sh # alias ohmyzsh="mate ~/.oh-my-zsh" # [[ -f {{@@ env['HOME'] @@}}/.files/dotdrop.sh ]] && alias dotdrop='eval $(grep -v "^#" {{@@ env['HOME'] @@}}/.files/.env.public) {{@@ env['HOME'] @@}}/.files/dotdrop.sh' # Not required anymore since I now use [[ $(command -v thefuck) ]] && eval $(thefuck --alias) -#{%@@ if profile == 'AINCRAD-wsl' or profile == 'YOETUNHEIMR-wsl' or profile == 'ymir' @@%} +#{%@@ if linux == true @@%} # Use https://github.com/jgaa/shinysocks as simple socks5 proxy for windows #[[ $(command -v kubectl) ]] && alias proxy_kubectl="http_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 https_proxy=socks5://$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):1080 kubectl" #[[ $(command -v kubectl) ]] && alias pk='proxy_kubectl' @@ -173,7 +173,7 @@ alias ssh-strongbox-keys="SSH_AUTH_SOCK=~/Library/Group\ Containers/group.strong # Include $(go env GOPATH) to PATH [[ $(command -v go) ]] && [[ -d "$(go env GOPATH)/bin" ]] && export PATH="$(go env GOPATH)/bin:${PATH}" -{%@@ if profile == 'WVDEWOBMC001307' or profile == 'susanoo.local' @@%} +{%@@ if distro == 'macos' @@%} # Decide which homebrew installation (x64_86 / arm64) should be used if [ "$(sysctl -n sysctl.proc_translated)" = "1" ]; then local brew_path="/usr/local/homebrew/bin"