From 2099be310912528c7b06ae201fcb2ffb8d4f2fa9 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@kateryna)" Date: Mon, 25 Nov 2024 17:43:38 -0500 Subject: [PATCH 1/4] Generalize refreshPeriod by using a variable --- _home/.chezmoiexternal.yaml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/_home/.chezmoiexternal.yaml b/_home/.chezmoiexternal.yaml index 9e66ea0..d41a0d3 100644 --- a/_home/.chezmoiexternal.yaml +++ b/_home/.chezmoiexternal.yaml @@ -1,9 +1,22 @@ # 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) -# refreshPeriod duration 0 Refresh period (Examples: one day (24h), one week (168h), or four weeks (672h)) +# 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 + +{{ $defaultRefresh := "168h" -}} +{{- $externals := dict -}} -{{ $externals := dict -}} {{- with $repo := "dandavison/delta" -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}} @@ -11,8 +24,8 @@ "type" "archive-file" "url" (printf "https://github.com/%s/releases/download/%s/delta-%s-x86_64-unknown-linux-musl.tar.gz" $repo $version $version) "path" (printf "delta-%s-x86_64-unknown-linux-musl/delta" $version) - "refreshPeriod" "168h") --}} + "refreshPeriod" $defaultRefresh +) -}} {{- end -}} {{- end -}} @@ -22,8 +35,8 @@ "type" "archive-file" "url" (printf "https://github.com/%s/releases/download/v%s/git-credential-oauth_%s_linux_amd64.tar.gz" $repo $version $version) "path" "git-credential-oauth" - "refreshPeriod" "168h") --}} + "refreshPeriod" $defaultRefresh +) -}} {{- end -}} {{- end -}} @@ -32,8 +45,8 @@ {{- $_ := set $externals ".cache/chezmoi/tmp/zellij" (dict "type" "archive" "url" (printf "https://github.com/%s/releases/download/%s/zellij-x86_64-unknown-linux-musl.tar.gz" $repo $version) - "refreshPeriod" "168h") --}} + "refreshPeriod" $defaultRefresh +) -}} {{- end -}} {{- end -}} @@ -41,15 +54,14 @@ ".config/sz.env/lib/ble.sh.curl": type: "archive" url: "https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz" - refreshPeriod: "168h" + refreshPeriod: "{{ $defaultRefresh }}" ".config/sz.env/lib/delta.themes.gitconfig": type: "file" url: "https://raw.githubusercontent.com/dandavison/delta/refs/heads/main/themes.gitconfig" - refreshPeriod: "168h" + refreshPeriod: "{{ $defaultRefresh }}" ".config/sz.env/lib/bash-preexec/bash-preexec.sh": type: "file" url: "https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh" - refreshPeriod: "168h" - + refreshPeriod: "{{ $defaultRefresh }}" From 9512cb7225159cef126980a457913ab709316e13 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@kateryna)" Date: Mon, 25 Nov 2024 17:44:57 -0500 Subject: [PATCH 2/4] Add executable flag to externals --- _home/.chezmoiexternal.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_home/.chezmoiexternal.yaml b/_home/.chezmoiexternal.yaml index d41a0d3..579bb4a 100644 --- a/_home/.chezmoiexternal.yaml +++ b/_home/.chezmoiexternal.yaml @@ -35,6 +35,7 @@ "type" "archive-file" "url" (printf "https://github.com/%s/releases/download/v%s/git-credential-oauth_%s_linux_amd64.tar.gz" $repo $version $version) "path" "git-credential-oauth" + "executable" true "refreshPeriod" $defaultRefresh ) -}} {{- end -}} @@ -45,6 +46,7 @@ {{- $_ := set $externals ".cache/chezmoi/tmp/zellij" (dict "type" "archive" "url" (printf "https://github.com/%s/releases/download/%s/zellij-x86_64-unknown-linux-musl.tar.gz" $repo $version) + "executable" true "refreshPeriod" $defaultRefresh ) -}} {{- end -}} From 3b01da4041dc3733447a903856aff13851e5cdd7 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@kateryna)" Date: Mon, 25 Nov 2024 17:47:26 -0500 Subject: [PATCH 3/4] Add gitui external (and reorder a bit) --- _home/.chezmoiexternal.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/_home/.chezmoiexternal.yaml b/_home/.chezmoiexternal.yaml index 579bb4a..b01856f 100644 --- a/_home/.chezmoiexternal.yaml +++ b/_home/.chezmoiexternal.yaml @@ -17,6 +17,17 @@ {{ $defaultRefresh := "168h" -}} {{- $externals := dict -}} +{{- 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-x86_64-unknown-linux-musl.tar.gz" $repo $version) + "path" "zellij" + "executable" true + "refreshPeriod" $defaultRefresh +) -}} +{{- end -}} +{{- end }} {{- with $repo := "dandavison/delta" -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}} @@ -41,16 +52,17 @@ {{- end -}} {{- end -}} -{{- with $repo := "zellij-org/zellij" -}} +{{- with $repo := "extrawurst/gitui" -}} {{- with $version := (gitHubLatestRelease $repo).GetTagName -}} -{{- $_ := set $externals ".cache/chezmoi/tmp/zellij" (dict - "type" "archive" - "url" (printf "https://github.com/%s/releases/download/%s/zellij-x86_64-unknown-linux-musl.tar.gz" $repo $version) +{{- $_ := set $externals ".local/bin/gitui" (dict + "type" "archive-file" + "url" (printf "https://github.com/%s/releases/download/%s/gitui-linux-x86_64.tar.gz" $repo $version) + "path" "./gitui" "executable" true "refreshPeriod" $defaultRefresh ) -}} {{- end -}} -{{- end -}} +{{- end }} {{- $externals | toYaml }} ".config/sz.env/lib/ble.sh.curl": From 0348e51bacc93c5cc589d7615b1fd531b17737c8 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@kateryna)" Date: Mon, 25 Nov 2024 17:47:51 -0500 Subject: [PATCH 4/4] Add nvim.AppImage external --- _home/.chezmoiexternal.yaml | 6 ++++++ _home/private_dot_local/bin/symlink_nvim | 1 + _home/private_dot_local/bin/symlink_vi | 1 + _home/private_dot_local/bin/symlink_vim | 1 + _home/private_dot_local/bin/symlink_vim.tiny | 1 + _home/private_dot_local/bin/symlink_vimdiff | 1 + 6 files changed, 11 insertions(+) create mode 100644 _home/private_dot_local/bin/symlink_nvim create mode 100644 _home/private_dot_local/bin/symlink_vi create mode 100644 _home/private_dot_local/bin/symlink_vim create mode 100644 _home/private_dot_local/bin/symlink_vim.tiny create mode 100644 _home/private_dot_local/bin/symlink_vimdiff diff --git a/_home/.chezmoiexternal.yaml b/_home/.chezmoiexternal.yaml index b01856f..9f0adc3 100644 --- a/_home/.chezmoiexternal.yaml +++ b/_home/.chezmoiexternal.yaml @@ -79,3 +79,9 @@ type: "file" url: "https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh" refreshPeriod: "{{ $defaultRefresh }}" + +".local/bin/nvim.AppImage": + type: "file" + url: "https://github.com/neovim/neovim/releases/download/stable/nvim.appimage" + executable: true + refreshPeriod: "{{ $defaultRefresh }}" diff --git a/_home/private_dot_local/bin/symlink_nvim b/_home/private_dot_local/bin/symlink_nvim new file mode 100644 index 0000000..f280f47 --- /dev/null +++ b/_home/private_dot_local/bin/symlink_nvim @@ -0,0 +1 @@ +nvim.AppImage diff --git a/_home/private_dot_local/bin/symlink_vi b/_home/private_dot_local/bin/symlink_vi new file mode 100644 index 0000000..f280f47 --- /dev/null +++ b/_home/private_dot_local/bin/symlink_vi @@ -0,0 +1 @@ +nvim.AppImage diff --git a/_home/private_dot_local/bin/symlink_vim b/_home/private_dot_local/bin/symlink_vim new file mode 100644 index 0000000..f280f47 --- /dev/null +++ b/_home/private_dot_local/bin/symlink_vim @@ -0,0 +1 @@ +nvim.AppImage diff --git a/_home/private_dot_local/bin/symlink_vim.tiny b/_home/private_dot_local/bin/symlink_vim.tiny new file mode 100644 index 0000000..f280f47 --- /dev/null +++ b/_home/private_dot_local/bin/symlink_vim.tiny @@ -0,0 +1 @@ +nvim.AppImage diff --git a/_home/private_dot_local/bin/symlink_vimdiff b/_home/private_dot_local/bin/symlink_vimdiff new file mode 100644 index 0000000..f280f47 --- /dev/null +++ b/_home/private_dot_local/bin/symlink_vimdiff @@ -0,0 +1 @@ +nvim.AppImage