Rearanging and merging aliases.env
This commit is contained in:
parent
61b5f3f441
commit
fa83394898
|
@ -1,156 +0,0 @@
|
|||
# https://www.chezmoi.io/reference/special-files-and-directories/chezmoiexternal-format/
|
||||
#
|
||||
# The externals are checked based on the refreshPeriod whenever an `apply` (or `update`) operations run
|
||||
#
|
||||
# The simplest form to update all externals:
|
||||
# ```sh
|
||||
# chezmoi apply --include externals
|
||||
# ```
|
||||
#
|
||||
# Variable Type Default Description
|
||||
# type string none External type (file, archive, archive-file, or git-repo)
|
||||
# url string none URL
|
||||
# refreshPeriod duration 0 Refresh period (Examples: one day (24h), one week (168h), or four weeks (672h))
|
||||
# executable bool false Add executable_ attribute to file
|
||||
# path string none Path to file in archive
|
||||
|
||||
{{- if not (env "OFFLINE") -}}
|
||||
|
||||
{{ $defaultRefresh := "168h" -}}
|
||||
{{- $externals := dict -}}
|
||||
|
||||
{{ $myArch := "aarch64-apple-darwin" }}
|
||||
|
||||
{{- with $repo := "zellij-org/zellij" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".cache/chezmoi/tmp/zellij" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/zellij-%s.tar.gz" $repo $version $myArch)
|
||||
"path" "zellij"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- with $repo := "dandavison/delta" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/delta" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/delta-%s-%s.tar.gz" $repo $version $version $myArch)
|
||||
"path" (printf "delta-%s-%s/delta" $version $myArch)
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $repo := "bitwarden/sdk-sm" -}}
|
||||
{{- with $version := trimPrefix "bws-v" (gitHubReleases "bitwarden/sdk-sm" | toJson | fromJson | jq "map(select(.tag_name | startswith(\"bws-v\")))[0] | .tag_name" | first ) -}}
|
||||
{{- $_ := set $externals ".local/bin/bws" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/bws-v%s/bws-%s-%s.zip" $repo $version $myArch $version)
|
||||
"path" "bws"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $myArch = "darwin_arm64" }}
|
||||
|
||||
{{- with $repo := "hickford/git-credential-oauth" -}}
|
||||
{{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/git-credential-oauth" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/v%s/git-credential-oauth_%s_%s.tar.gz" $repo $version $version $myArch)
|
||||
"path" "git-credential-oauth"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $repo := "knqyf263/pet" -}}
|
||||
{{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/pet" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/v%s/pet_%s_%s.tar.gz" $repo $version $version $myArch)
|
||||
"path" "pet"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $myArch = "mac" }}
|
||||
|
||||
{{- with $repo := "extrawurst/gitui" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/gitui" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/gitui-%s.tar.gz" $repo $version $myArch)
|
||||
"path" "./gitui"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{ $myArch = "Darwin_arm64" }}
|
||||
|
||||
{{- with $repo := "theimpostor/osc" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/osc" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/osc_%s.tar.gz" $repo $version $myArch)
|
||||
"path" "osc"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{ $myArch = "darwin-arm64" }}
|
||||
|
||||
{{- with $repo := "Lifailon/lazyjournal" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/lazyjournal" (dict
|
||||
"type" "file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/lazyjournal-%s-%s" $repo $version $version $myArch)
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{ $myArch = "macos-arm64" }}
|
||||
|
||||
{{- with $repo := "alexpasmantier/television" -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/tv" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/tv-%s-%s.tar.gz" $repo $version $version $myArch)
|
||||
"path" "tv"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- $externals | toYaml }}
|
||||
|
||||
".config/sz.env/lib/delta.themes.gitconfig":
|
||||
type: "file"
|
||||
url: "https://raw.githubusercontent.com/dandavison/delta/refs/heads/main/themes.gitconfig"
|
||||
refreshPeriod: "{{ $defaultRefresh }}"
|
||||
|
||||
".config/nvim":
|
||||
type: "git-repo"
|
||||
url: "https://code.lksz.me/szmedia/kickstart-modular.nvim.sz.git"
|
||||
refreshPeriod: "{{ $defaultRefresh }}"
|
||||
|
||||
{{- else -}}
|
||||
# .chezmoiexternal is disabled because OFFLINE env is defined
|
||||
{{- end -}}
|
||||
|
||||
# vim: set ft=go sw=2 sts=2 et:
|
|
@ -0,0 +1 @@
|
|||
../_src.posix/.chezmoiexternal.yaml.tmpl
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/.aliases.macos.env
|
|
@ -0,0 +1 @@
|
|||
../../../_src.posix/private_dot_config/sz.env/aliases.env
|
|
@ -40,6 +40,8 @@ scriptTempDir={{- $scriptTempDir | quote }}
|
|||
[data.sz.os]
|
||||
{{- if eq .chezmoi.os "linux" }}
|
||||
short={{- .chezmoi.os | quote }}
|
||||
{{- else if eq .chezmoi.os "darwin" }}
|
||||
short="mac"
|
||||
{{- else }}
|
||||
short={{- substr 0 3 (.chezmoi.os) | quote }}
|
||||
{{- end }}
|
||||
|
|
|
@ -81,6 +81,18 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $repo := "noborus/ov" -}}
|
||||
{{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals ".local/bin/ov" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/v%s/ov_%s_%s.zip" $repo $version $version $myArch)
|
||||
"path" "ov"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
# valid arch strings:
|
||||
# linux-aarch64
|
||||
|
@ -161,6 +173,30 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
# valid arch strings:
|
||||
# darwin-amd64
|
||||
# darwin-arm64
|
||||
# linux-386
|
||||
# linux-amd64
|
||||
# linux-arm64
|
||||
*/}}
|
||||
{{- $myArch = (printf "%s-%s" .chezmoi.os .chezmoi.arch) -}}
|
||||
|
||||
{{- if and (env "TELEPORT_MAJOR") (not (eq .chezmoi.os "windows")) -}}
|
||||
{{- with $repo := "gravitational/teleport" -}}
|
||||
{{- with $version := (gitHubReleases $repo | toJson | fromJson | jq (printf "map(select(.tag_name | startswith(\"v%s\")))[0] | .tag_name" (env "TELEPORT_MAJOR")) | first ) -}}
|
||||
{{- $_ := set $externals ".local/bin/tsh" (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://cdn.teleport.dev/teleport-%s-%s-bin.tar.gz" $version $myArch)
|
||||
"path" "teleport/tsh"
|
||||
"executable" true
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- $externals | toYaml }}
|
||||
".config/sz.env/lib/ble.sh.curl":
|
||||
type: "archive"
|
||||
|
@ -177,11 +213,13 @@
|
|||
url: "https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh"
|
||||
refreshPeriod: "{{ $defaultRefresh }}"
|
||||
|
||||
{{- if eq .chezmoi.os "linux" -}}
|
||||
".local/bin/nvim.AppImage":
|
||||
type: "file"
|
||||
url: "https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage"
|
||||
executable: true
|
||||
refreshPeriod: "{{ $defaultRefresh }}"
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
# .chezmoiexternal is disabled because CZ_EXTR env is undefined
|
|
@ -5,6 +5,9 @@
|
|||
[include]
|
||||
path = .config/sz.env/lib/delta.themes.gitconfig
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[user]
|
||||
name = {{ .gitName }}
|
||||
email = {{ .gitEmail }}
|
||||
|
@ -36,13 +39,20 @@
|
|||
# oauthScopes = read_repository
|
||||
[core]
|
||||
editor = vim
|
||||
pager = delta
|
||||
# delta will used as the default pager for git
|
||||
# and ov as the default pager for delta
|
||||
# the pager will be overloaded via the [pager] section for a few commands
|
||||
pager = delta --pager='ov -F'
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[pager]
|
||||
# overload delta pager for some commands
|
||||
show = delta --pager='ov -F --header 3'
|
||||
|
||||
[core]
|
||||
pager = delta
|
||||
# We are now overloading some commands via "delta features"
|
||||
# This allows us to use different pager per git command
|
||||
# It allows to maintain a simpler config file and avoid escaping quotes
|
||||
diff = delta --features ov-diff
|
||||
log = delta --features ov-log
|
||||
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
|
@ -52,6 +62,20 @@
|
|||
navigate = true # use n and N to move between diff sections
|
||||
line-numbers = true
|
||||
side-by-side = true
|
||||
file-style = yellow
|
||||
|
||||
# we define the delta feature "ov-diff" we are using for git diff
|
||||
[delta "ov-diff"]
|
||||
# the idea is to overload the pager used by delta when using git diff
|
||||
# we are using the same pattern used by delta when the default pager (less) is used
|
||||
# using ov section feature brings a better experience
|
||||
pager=ov -F --section-delimiter '^(commit|added:|removed:|renamed:|Δ)' --section-header --pattern '•'
|
||||
|
||||
# we define the delta feature "ov-log" we are using for git log
|
||||
[delta "ov-log"]
|
||||
# the idea is to overload the pager used by delta when using git log
|
||||
# using ov section feature brings a better experience
|
||||
pager=ov -F --section-delimiter '^commit' --section-header-num 3
|
||||
|
||||
[diff]
|
||||
tool = nvimdiff
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
|
||||
|
||||
alias l='ls -lahF --color=auto '
|
||||
alias lu='l -U '
|
||||
alias lold='l -t '
|
||||
alias lnew='l -tr '
|
||||
alias lu='l -U '
|
||||
alias ll='l -A'
|
||||
|
||||
alias sudo='sudo '
|
|
@ -1,14 +1,21 @@
|
|||
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
|
||||
|
||||
{{- if eq .chezmoi.os "darwin" }}
|
||||
alias l='ls -lahF --color=auto '
|
||||
alias lold='l -t '
|
||||
alias lnew='l -tr '
|
||||
{{ else }}
|
||||
alias l='ls -lahF --color=auto --group-directories-first '
|
||||
alias lu='l -U '
|
||||
alias lold='l --sort=time '
|
||||
alias lnew='l --sort=time --reverse '
|
||||
{{- end }}
|
||||
alias ll='l -A'
|
||||
alias lu='l -U '
|
||||
|
||||
alias sudo='sudo '
|
||||
|
||||
is_cmd nvim \
|
||||
&& export VISUAL="nvim" EDITOR="nvim" \
|
||||
&& alias nvim='POSTFIX_BUITINS=1 command nvim -p ' \
|
||||
|| alias nvim='POSTFIX_BUITINS=1 command vim -p '
|
||||
alias vi='nvim '
|
||||
|
|
|
@ -8,7 +8,7 @@ if is_cmd 'chezmoi'; then
|
|||
export CHEZMOI_GITHUB_ACCESS_TOKEN={{- .githubToken | quote }}
|
||||
|
||||
czcd() {
|
||||
cd "$(chezmoi source-path "${@}")"
|
||||
cd "$(chezmoi source-path "${@}")"
|
||||
}
|
||||
czedext() {
|
||||
local CZ_EXT="$(find $(chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
|
||||
|
@ -16,8 +16,16 @@ if is_cmd 'chezmoi'; then
|
|||
"${VISUAL:-${EDITOR:-vi}}" "${CZ_EXT}"
|
||||
}
|
||||
czed() {
|
||||
chezmoi edit "${@}" --apply --interactive
|
||||
local EDITLIST=() f _f
|
||||
for _f in "${@}"; do
|
||||
[[ -e "$_f" ]] || f="$(which "$_f")"
|
||||
[[ -z "$f" ]] && is_cmd tv && f="$(tv "$_f")" || f=$_f
|
||||
EDITLIST=( "${EDITLIST[@]}" "$f" )
|
||||
done
|
||||
EDITLIST=("${@}")
|
||||
chezmoi edit "${EDITLIST[@]}" --apply --interactive
|
||||
}
|
||||
alias czx="CZ_EXTR=1 chezmoi "
|
||||
fi
|
||||
|
||||
# vim: set ft=bash sw=4 sts=4 et:
|
||||
|
|
Loading…
Reference in New Issue