Formatting .chezmoiexternal.yaml - more templating

This commit is contained in:
Lockszmith (@VAST) 2025-04-09 13:13:44 -04:00
parent bc8ae6dec2
commit 8639a85a3f
1 changed files with 104 additions and 105 deletions

View File

@ -33,50 +33,49 @@
{{ $myArch = (printf "%s-%s" .sz.os.arch_alt .sz.os.rust_rel_target )}} {{ $myArch = (printf "%s-%s" .sz.os.arch_alt .sz.os.rust_rel_target )}}
{{- with $repo := "zellij-org/zellij" -}} {{- with $app_name := "zellij" -}}
{{- with $repo := (printf "%s/%s" "zellij-org" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".cache/chezmoi/tmp/zellij" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/zellij-%s.tar.gz" $repo $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.tar.gz" $repo $version $app_name $myArch)
"path" "zellij" "path" $app_name
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{- with $repo := "dandavison/delta" -}} {{- with $app_name := "delta" -}}
{{- with $repo := (printf "%s/%s" "dandavison" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/delta" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/delta-%s-%s.tar.gz" $repo $version $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s.tar.gz" $repo $version $app_name $version $myArch)
"path" (printf "delta-%s-%s/delta" $version $myArch) "path" (printf "%s-%s-%s/%s" $app_name $version $myArch $app_name)
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{- with $repo := "atuinsh/atuin" -}} {{- with $app_name := "atuin" -}}
{{- with $repo := (printf "%s/%s" "atuinsh" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/atuin" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/atuin-%s.tar.gz" $repo $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.tar.gz" $repo $version $app_name $myArch)
"path" (printf "atuin-%s/atuin" $myArch) "path" (printf "%s-%s/%s" $app_name $myArch $app_name )
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{- if (eq .chezmoi.os "linux") -}} {{- if (eq .chezmoi.os "linux") -}}
{{- with $repo := "sharkdp/vivid" -}}
{{- with $app_name := "vivid" -}} {{- with $app_name := "vivid" -}}
{{- with $repo := (printf "%s/%s" "sharkdp" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/vivid" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s.tar.gz" $repo $version $app_name $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s.tar.gz" $repo $version $app_name $version $myArch)
"path" (printf "%s-%s-%s/%s" $app_name $version $myArch $app_name) "path" (printf "%s-%s-%s/%s" $app_name $version $myArch $app_name)
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}{{- end -}}{{- end -}}
{{/* {{/*
# valid arch strings: # valid arch strings:
@ -91,28 +90,27 @@
*/}} */}}
{{- $myArch = (printf "%s_%s" .chezmoi.os .chezmoi.arch) -}} {{- $myArch = (printf "%s_%s" .chezmoi.os .chezmoi.arch) -}}
{{- with $repo := "hickford/git-credential-oauth" -}} {{- with $app_name := "git-credential-oauth" -}}
{{- with $repo := (printf "%s/%s" "hickford" $app_name) -}}
{{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/git-credential-oauth" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/v%s/git-credential-oauth_%s_%s.tar.gz" $repo $version $version $myArch) "url" (printf "https://github.com/%s/releases/download/v%s/%s_%s_%s.tar.gz" $repo $version $app_name $version $myArch)
"path" "git-credential-oauth" "path" $app_name
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}
{{- end -}}
{{- with $repo := "noborus/ov" -}} {{- with $app_name := "ov" -}}
{{- with $repo := (printf "%s/%s" "noborus" $app_name) -}}
{{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/ov" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/v%s/ov_%s_%s.zip" $repo $version $version $myArch) "url" (printf "https://github.com/%s/releases/download/v%s/%s_%s_%s.zip" $repo $version $app_name $version $myArch)
"path" "ov" "path" $app_name
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{/* {{/*
# valid arch strings: # valid arch strings:
@ -130,16 +128,16 @@
{{- $myArch = (printf "%s-%s" .chezmoi.os .sz.os.arch_alt) -}} {{- $myArch = (printf "%s-%s" .chezmoi.os .sz.os.arch_alt) -}}
{{- end -}} {{- end -}}
{{- with $repo := "extrawurst/gitui" -}} {{- with $app_name := "gitui" -}}
{{- with $repo := (printf "%s/%s" "extrawurst" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/gitui" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/gitui-%s.tar.gz" $repo $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.tar.gz" $repo $version $app_name $myArch)
"path" "./gitui" "path" (printf "./%s" $app_name)
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{/* {{/*
@ -157,26 +155,26 @@
*/}} */}}
{{- $myArch = (print .chezmoi.os "-" .chezmoi.arch) -}} {{- $myArch = (print .chezmoi.os "-" .chezmoi.arch) -}}
{{- with $repo := "Lifailon/lazyjournal" -}} {{- with $app_name := "lazyjournal" -}}
{{- with $repo := (printf "%s/%s" "Lifailon" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/lazyjournal" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "file" "type" "file"
"url" (printf "https://github.com/%s/releases/download/%s/lazyjournal-%s-%s" $repo $version $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s" $repo $version $app_name $version $myArch)
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}
{{- if (not (eq .chezmoi.os "darwin")) -}} {{- if (not (eq .chezmoi.os "darwin")) -}}
{{- with $repo := "walles/moar" -}} {{- with $app_name := "moar" -}}
{{- with $repo := (printf "%s/%s" "walles" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/moar" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "file" "type" "file"
"url" (printf "https://github.com/%s/releases/download/%s/moar-%s-%s" $repo $version $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s" $repo $version $app_name $version $myArch)
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end -}}{{- end -}}
{{- end -}}{{- end -}}{{- end -}}
{{/* {{/*
# valid arch strings: # valid arch strings:
@ -191,16 +189,17 @@
*/}} */}}
{{- $myArch = (printf "%s_%s" ( .chezmoi.os | title ) .sz.os.arch_alt) -}} {{- $myArch = (printf "%s_%s" ( .chezmoi.os | title ) .sz.os.arch_alt) -}}
{{- with $repo := "theimpostor/osc" -}} {{- with $app_name := "osc" -}}
{{- with $repo := (printf "%s/%s" "theimpostor" $app_name) -}}
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
{{- $_ := set $externals ".local/bin/osc" (dict {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://github.com/%s/releases/download/%s/osc_%s.tar.gz" $repo $version $myArch) "url" (printf "https://github.com/%s/releases/download/%s/%s_%s.tar.gz" $repo $version $app_name $myArch)
"path" "osc" "path" $app_name
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}
{{- end -}}{{- end -}} {{- end -}}{{- end -}}{{- end -}}
{{/* {{/*
# valid arch strings: # valid arch strings:
@ -213,16 +212,16 @@
{{- $myArch = (printf "%s-%s" .chezmoi.os .chezmoi.arch) -}} {{- $myArch = (printf "%s-%s" .chezmoi.os .chezmoi.arch) -}}
{{- if and (env "TELEPORT_MAJOR") (not (eq .chezmoi.os "windows")) -}} {{- if and (env "TELEPORT_MAJOR") (not (eq .chezmoi.os "windows")) -}}
{{- with $repo := "gravitational/teleport" -}} {{- with $app_name := "tsh" -}}
{{- with $repo := (printf "%s/%s" "gravitational" "teleport") -}}
{{- with $version := (gitHubReleases $repo | toJson | fromJson | jq (printf "map(select(.tag_name | startswith(\"v%s\")))[0] | .tag_name" (env "TELEPORT_MAJOR")) | first ) -}} {{- 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 {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
"type" "archive-file" "type" "archive-file"
"url" (printf "https://cdn.teleport.dev/teleport-%s-%s-bin.tar.gz" $version $myArch) "url" (printf "https://cdn.teleport.dev/teleport-%s-%s-bin.tar.gz" $version $myArch)
"path" "teleport/tsh" "path" (printf "teleport/%s" $app_name)
"executable" true "executable" true
"refreshPeriod" $defaultRefresh "refreshPeriod" $defaultRefresh
) -}} ) -}}{{- end -}}{{- end -}}{{- end }}{{- end -}}
{{- end -}}{{- end -}}{{- end }}
{{- $externals | toYaml }} {{- $externals | toYaml }}
".config/sz.env/lib/ble.sh.curl": ".config/sz.env/lib/ble.sh.curl":