From 811e646945095555682b483c2a6e0969739800c6 Mon Sep 17 00:00:00 2001 From: "Lockszmith (wsl@Sygin)" Date: Sat, 12 Apr 2025 09:37:04 -0400 Subject: [PATCH 1/4] Add gojq as a consistent, portable jq implementation --- _src.posix/.chezmoiexternal.yaml.tmpl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/_src.posix/.chezmoiexternal.yaml.tmpl b/_src.posix/.chezmoiexternal.yaml.tmpl index 87cd982..f13efff 100644 --- a/_src.posix/.chezmoiexternal.yaml.tmpl +++ b/_src.posix/.chezmoiexternal.yaml.tmpl @@ -148,6 +148,17 @@ */}} {{- $myArch = (printf "%s_%s" .chezmoi.os .chezmoi.arch) -}} +{{- with $app_name := "gojq" -}} +{{- with $repo := (printf "%s/%s" "itchyny" $app_name) -}} +{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} +{{- $_ := set $externals (printf ".local/bin/%s" "jq") (dict + "type" "archive-file" + "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) + "executable" true + "refreshPeriod" $defaultRefresh +) -}}{{- end -}}{{- end -}}{{- end -}} + {{- with $app_name := "git-credential-oauth" -}} {{- with $repo := (printf "%s/%s" "hickford" $app_name) -}} {{- with $version := trimPrefix "v" (gitHubLatestRelease $repo).GetTagName -}} From efc7e2c29c9066a4acf820af1736a9d083c77169 Mon Sep 17 00:00:00 2001 From: "Lockszmith (wsl@Sygin)" Date: Sat, 12 Apr 2025 09:37:57 -0400 Subject: [PATCH 2/4] Make sure jq is installed before attempting to use it --- _src.posix/.chezmoiexternal.yaml.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_src.posix/.chezmoiexternal.yaml.tmpl b/_src.posix/.chezmoiexternal.yaml.tmpl index f13efff..dc65674 100644 --- a/_src.posix/.chezmoiexternal.yaml.tmpl +++ b/_src.posix/.chezmoiexternal.yaml.tmpl @@ -99,6 +99,7 @@ "refreshPeriod" $defaultRefresh ) -}}{{- end -}}{{- end -}}{{- end -}} +{{- if lookPath "jq" -}} {{- with $app_name := "eza" -}} {{- with $bin_url := (output "sh" "-c" ( list @@ -134,6 +135,7 @@ "executable" true "refreshPeriod" $defaultRefresh ) -}}{{- end -}}{{- end -}}{{- end -}} +{{- end -}} {{/* # valid arch strings: @@ -331,4 +333,3 @@ executable: true refreshPeriod: "{{ $defaultRefresh }}" {{- end -}} - From 5629133ec3c55cc8ea4ca6e4386eea249895e8dd Mon Sep 17 00:00:00 2001 From: "Lockszmith (wsl@Sygin)" Date: Sat, 12 Apr 2025 09:38:36 -0400 Subject: [PATCH 3/4] Fix eza in different platforms --- _src.posix/.chezmoiexternal.yaml.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_src.posix/.chezmoiexternal.yaml.tmpl b/_src.posix/.chezmoiexternal.yaml.tmpl index dc65674..d691519 100644 --- a/_src.posix/.chezmoiexternal.yaml.tmpl +++ b/_src.posix/.chezmoiexternal.yaml.tmpl @@ -100,6 +100,7 @@ ) -}}{{- end -}}{{- end -}}{{- end -}} {{- if lookPath "jq" -}} +{{- $path_prefix := or (get (dict "linux" "./") .chezmoi.os) "" -}} {{- with $app_name := "eza" -}} {{- with $bin_url := (output "sh" "-c" ( list @@ -113,7 +114,7 @@ {{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict "type" "archive-file" "url" $bin_url - "path" $app_name + "path" (printf "%s%s" $path_prefix $app_name) "executable" true "refreshPeriod" $defaultRefresh ) -}}{{- end -}}{{- end -}}{{- end -}} From 7be26f591e44daeaa15711773856b3515d428b70 Mon Sep 17 00:00:00 2001 From: "Lockszmith (wsl@Sygin)" Date: Sat, 12 Apr 2025 09:38:51 -0400 Subject: [PATCH 4/4] add fastfetch --- _src.posix/.chezmoiexternal.yaml.tmpl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/_src.posix/.chezmoiexternal.yaml.tmpl b/_src.posix/.chezmoiexternal.yaml.tmpl index d691519..d7f809e 100644 --- a/_src.posix/.chezmoiexternal.yaml.tmpl +++ b/_src.posix/.chezmoiexternal.yaml.tmpl @@ -233,6 +233,17 @@ "refreshPeriod" $defaultRefresh ) -}}{{- end -}}{{- end -}}{{- end -}} +{{- with $app_name := "fastfetch" -}} +{{- with $repo := (printf "%s/%s" "fastfetch-cli" $app_name) -}} +{{- with $version := (gitHubLatestRelease $repo).GetTagName -}} +{{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict + "type" "archive-file" + "url" (printf "https://github.com/%s/releases/download/%s/%s-%s.tar.gz" $repo $version $app_name $myArch) + "executable" true + "path" (printf "%s-%s/usr/bin/%s" $app_name $myArch $app_name) + "refreshPeriod" $defaultRefresh +) -}}{{- end -}}{{- end -}}{{- end -}} + {{- if (not (eq .chezmoi.os "darwin")) -}} {{- with $app_name := "moar" -}} {{- with $repo := (printf "%s/%s" "walles" $app_name) -}}