# https://www.chezmoi.io/reference/special-files-and-directories/chezmoiexternal-format/ # The file will be empty (except for this comment) unless CZ_EXTR env variable exists. # # The externals are checked based on the refreshPeriod whenever an `apply` (or `update`) operations run # # The syntax to update all externals (and nothing else): # ```sh # CZ_EXTR=1 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 (env "CZ_EXTR") -}} {{/* Initialize template variables */}} {{- $myArch := "" -}} {{- $defaultRefresh := "168h" -}} {{- $externals := dict -}} {{/* # valid arch strings: # aarch64-apple-darwin # x86_64-apple-darwin # aarch64-unknown-linux-musl # x86_64-unknown-linux-musl */}} {{ $myArch = (printf "%s-%s" .sz.os.arch_alt .sz.os.rust_rel_target )}} {{- 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 -}} {{/* # valid arch strings: # darwin_amd64 # darwin_arm64 # linux_386 # linux_amd64 # linux_arm64 # windows_386 # windows_amd64 # windows_arm64 */}} {{- $myArch = (printf "%s_%s" .chezmoi.os .chezmoi.arch) -}} {{- 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 -}} {{/* # valid arch strings: # linux-aarch64 # linux-arm # linux-armv7 # linux-x86_64 # mac-x86 # mac # win */}} {{- $myArch = .sz.os.short -}} {{- if eq .chezmoi.os "linux" -}} {{- $myArch = (printf "%s-%s" .chezmoi.os .sz.os.arch_alt) -}} {{- end -}} {{- 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 -}} {{/* # valid arch strings: # darwin-amd64 # darwin-arm64 # freebsd-amd64 # freebsd-arm64 # linux-amd64 # linux-arm64 # openbsd-amd64 # openbsd-arm64 # windows-amd64 # windows-arm64 */}} {{- $myArch = (print .chezmoi.os "-" .chezmoi.arch) -}} {{- 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 -}} {{/* # valid arch strings: # Darwin_arm64 # Darwin_x86_64 # Linux_arm64 # Linux_i386 # Linux_x86_64 # Windows_arm64 # Windows_i386 # Windows_x86_64 */}} {{- $myArch = (printf "%s_%s" ( .chezmoi.os | title ) .sz.os.arch_alt) -}} {{- 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 -}} {{- $externals | toYaml }} ".config/sz.env/lib/ble.sh.curl": type: "archive" url: "https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz" refreshPeriod: "{{ $defaultRefresh }}" ".config/sz.env/lib/delta.themes.gitconfig": type: "file" url: "https://raw.githubusercontent.com/dandavison/delta/refs/heads/main/themes.gitconfig" 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: "{{ $defaultRefresh }}" ".local/bin/nvim.AppImage": type: "file" url: "https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage" executable: true refreshPeriod: "{{ $defaultRefresh }}" {{- else -}} # .chezmoiexternal is disabled because CZ_EXTR env is undefined {{- end -}}