From fed4970b6425fb5223ca50cbbebccfc9f64364d8 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Mon, 26 Sep 2022 12:08:18 -0400 Subject: [PATCH] Moved externals to separate chezmoi repo Following discussion on --- _home/.chezmoiexternal.toml | 85 +------------------------- _home/dot_sz.shrc.d/97_chezmoi_aliases | 33 +++++----- 2 files changed, 21 insertions(+), 97 deletions(-) diff --git a/_home/.chezmoiexternal.toml b/_home/.chezmoiexternal.toml index aa2d9c6..31be46d 100644 --- a/_home/.chezmoiexternal.toml +++ b/_home/.chezmoiexternal.toml @@ -1,85 +1,4 @@ -{{ if eq .chezmoi.hostname "pqb-laptop" }} -[".local/share/git-on-web/chemacs2"] +[".local/share/chezmoi.externals"] type = "git-repo" - url = "https://github.com/plexus/chemacs2.git" - refreshPeriod = "168h" # 7 days - -[".config/_my.emacs/spacemacs/emacs.d"] - type = "git-repo" - url = "https://github.com/syl20bnr/spacemacs.git" - clone.args = ["--depth=1","--branch=develop","--single-branch"] - refreshPeriod = "168h" # 7 days - -[".config/_my.emacs/doom/emacs.d"] - type = "git-repo" - url = "https://github.com/doomemacs/doomemacs" - clone.args = ["--depth=1","--branch=develop","--single-branch"] - refreshPeriod = "168h" # 7 days -{{ end }} - -# ["my/code/from_web/nerd-fonts"] -# type = "git-repo" -# url = "https://github.com/ryanoasis/nerd-fonts.git" -# clone.args = ["--depth=1"] -# refreshPeriod = "168h" # 7 days - -[".local/share/bash-completion/tmux"] - type = "git-repo" - url = "https://github.com/imomaliev/tmux-bash-completion" - clone.args = ["--depth=1","--single-branch"] - refreshPeriod = "168h" # 7 days - -[".local/share/fonts/NF_CodeNewRoman"] - type = "archive" -# url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/CodeNewRoman.zip" - url = "https://github.com/ryanoasis/nerd-fonts/releases/download/2.2.0-RC/CodeNewRoman.zip" - exact = true - refreshPeriod = "168h" # 7 days - -[".local/share/fonts/NF_FiraCode"] - type = "archive" -# url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip" - url = "https://github.com/ryanoasis/nerd-fonts/releases/download/2.2.0-RC/FiraCode.zip" - exact = true - refreshPeriod = "168h" # 7 days - -[".local/bin/oh-my-posh"] - type = "file" - url = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64" - executable = true - -[".poshthemes"] - type = "archive" - url = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip" - exact = true - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/English (American).dic"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/English%20(American).dic" - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/English (American).aff"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/English%20(American).aff" - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/English (American).txt"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/English%20(American).txt" - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/Hebrew (Israel).dic"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Hebrew%20(Israel).dic" - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/Hebrew (Israel).aff"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Hebrew%20(Israel).aff" - refreshPeriod = "168h" # 7 days - -[".config/Code/Dictionaries/Hebrew (Israel).txt"] - type = "file" - url = "https://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Hebrew%20(Israel).txt" + url = "https://code.lksz.me/lksz/dotfiles.chezmoi.externals.git" refreshPeriod = "168h" # 7 days diff --git a/_home/dot_sz.shrc.d/97_chezmoi_aliases b/_home/dot_sz.shrc.d/97_chezmoi_aliases index 53f413c..c4d3bf4 100644 --- a/_home/dot_sz.shrc.d/97_chezmoi_aliases +++ b/_home/dot_sz.shrc.d/97_chezmoi_aliases @@ -1,43 +1,48 @@ if [[ -n "$(which-command chezmoi)" ]]; then export CZ="$(chezmoi source-path)" + export CZ_X="$CZ.externals" export CHEZMOIROOT="$CZ" - alias cdcz="cd $CZ" - alias czcd="cdcz " + alias czcd="cd $CZ" + alias czxcd="cd $CZ_X" alias cz="chezmoi " + alias czx="chezmoi --source $CZ_X --config $HOME/.config/chezmoi.externals/chezmoi.toml " - alias czs="chezmoi status " - - alias cz-refresh="chezmoi status | cut -d\ -f2 | grep '^\.sz\.shrc\.d' | xargs chezmoi forget --force; chezmoi add ~/.sz.shrc.d --recursive; chezmoi status; chezmoi git status" - alias cz-commit="chezmoi git -- commit -a " + alias czs="cz status " + + alias cz-refresh="czs | cut -d\ -f2 | grep '^\.sz\.shrc\.d' | xargs cz forget --force; cz add ~/.sz.shrc.d --recursive; cz status; cz git status" + alias cz-commit="cz git -- commit -a " + function cz() { + chezmoi "${@}" + } function cz-remove-missing() { pushd ~ > /dev/null - changes=$(chezmoi status | sed -n 's/^DA[ \t]\+//p') + changes=$(cz status | sed -n 's/^DA[ \t]\+//p') for c in $changes; do - chezmoi rm $c + cz rm $c done popd > /dev/null } function cz-add-changes() { pushd ~ > /dev/null - changes=$(chezmoi status | sed -n 's/^MM[ \t]\+//p') + changes=$(cz status | sed -n 's/^MM[ \t]\+//p') for c in $changes; do echo Adding $c - chezmoi add $c + cz add $c done popd > /dev/null } function cz-set-ssh-github() { - chezmoi git -- remote set-url origin "$(chezmoi git -- remote get-url origin | sed 's|https://github.com/|git@github.com:|')" - chezmoi git -- remote get-url origin + cz git -- remote set-url origin "$(cz git -- remote get-url origin | sed 's|https://github.com/|git@github.com:|')" + cz git -- remote get-url origin } function cz-set-https-github() { - chezmoi git -- remote set-url origin "$(chezmoi git -- remote get-url origin | sed 's|git@github.com:|https://github.com/|')" - chezmoi git -- remote get-url origin + cz git -- remote set-url origin "$(cz git -- remote get-url origin | sed 's|git@github.com:|https://github.com/|')" + cz git -- remote get-url origin } fi