changeset 1093:9732db099471 draft

feat: enable dotfiles on aarch64/Fedora
author "Zeger Van de Vannet <zeger@vandevan.net>"
date Sun, 18 May 2025 16:28:58 +0200
parents 6fb43864241b
children 4befa7ae4e90
files .chezmoiscripts/run_once_after_39-install-helix.sh.tmpl .chezmoiscripts/run_onchange_after_14-install-fedora-packages.sh.tmpl .chezmoiscripts/run_onchange_after_14-install-ubuntu-packages.sh.tmpl .chezmoiscripts/run_onchange_after_16-install-mise-and-plugins.sh.tmpl .chezmoiscripts/run_onchange_after_17-install-mercurial.sh.tmpl .chezmoiscripts/run_onchange_after_19-install-bitwarden.sh.tmpl .chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl .chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl dot_tool-versions
diffstat 9 files changed, 76 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoiscripts/run_once_after_39-install-helix.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_once_after_39-install-helix.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -16,7 +16,7 @@
 bash setup.sh
 popd
 
-{{ if (eq .chezmoi.osRelease.name "Ubuntu") }} $HOME/bin/mise x [email protected] -- {{ end }} cargo build --release --locked
+{{ if (or (eq .chezmoi.osRelease.name "Ubuntu") (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix")) }} $HOME/bin/mise x [email protected] -- {{ end }} cargo build --release --locked
 rm -rf $HELIX_DEFAULT_RUNTIME
 mkdir -p $HELIX_DEFAULT_RUNTIME
 cp -r runtime/* $HELIX_DEFAULT_RUNTIME/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_14-install-fedora-packages.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -0,0 +1,35 @@
+{{ if eq .chezmoi.os "linux" -}}
+{{ if eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix" -}}
+
+
+#!/usr/bin/env bash
+
+set -xe
+
+{{ $packages := list
+  "python-devel"
+  "make"
+  "automake"
+  "gcc"
+  "gcc-c++"
+  "zlib-devel"
+  "libsqlite3x-devel"
+  "readline-devel"
+  "ncurses-devel"
+  "libffi-devel"
+  "openssl-devel"
+  "jq"
+  "libevent"
+  "libevent-devel"
+  "pipx"
+  "bison"
+  "flex"
+  "libnotify"
+  "autoconf"
+  "fish" -}}
+
+sudo dnf -y install {{ $packages | join " " }}
+
+
+{{- end }}
+{{- end }}
--- a/.chezmoiscripts/run_onchange_after_14-install-ubuntu-packages.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_14-install-ubuntu-packages.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -13,15 +13,15 @@
   "software-properties-common"
   "fd-find"
   "ripgrep"
- 	"jq"
- 	"pass"
- 	"apt-file"
- 	"fonts-firacode"
- 	"kitty"
- 	"yodl"
- 	"libevent-core-2.1-7"
- 	"libevent-dev"
- 	"pipx"
+  "jq"
+  "pass"
+  "apt-file"
+  "fonts-firacode"
+  "kitty"
+  "yodl"
+  "libevent-core-2.1-7"
+  "libevent-dev"
+  "pipx"
   "bison"
   "flex"
   "libnotify4"
--- a/.chezmoiscripts/run_onchange_after_16-install-mise-and-plugins.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_16-install-mise-and-plugins.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -1,13 +1,22 @@
-{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}}
+{{ if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.name "Ubuntu" ) (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix"))) -}}
 #!/usr/bin/env bash
 
 set -xe
 
 # tool-versions hash: {{ include "dot_tool-versions" | sha256sum }}
+{{ $version := "2025.5.6" }}
+
+
+{{ $arch := "x64" }}
+{{ if (eq .chezmoi.arch "amd64") -}}
+{{ $arch = "x64" }}
+{{ else }}
+{{ $arch = "arm64" }}
+{{ end }}
 
 : "${XDG_CONFIG_HOME:=$HOME/.config}"
 RTX_BIN=$HOME/bin/mise
-curl -fsSL https://github.com/jdx/mise/releases/download/v2025.2.7/mise-v2025.2.7-linux-x64 | sudo install -m 755 /dev/stdin $RTX_BIN
+curl -fsSL https://github.com/jdx/mise/releases/download/v{{ $version }}/mise-v{{ $version }}-linux-{{ $arch }} | sudo install -m 755 /dev/stdin $RTX_BIN
 
 export PYTHON_CONFIGURE_OPTS="--enable-shared"
 $RTX_BIN install --verbose --yes
--- a/.chezmoiscripts/run_onchange_after_17-install-mercurial.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_17-install-mercurial.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -1,7 +1,7 @@
 {{ $version := "7.0.2" -}}
-{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+{{ if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.name "Ubuntu") (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix" ))) -}}
 #!/usr/bin/env -S ${HOME}/bin/mise exec [email protected] [email protected] -- bash
-{{ else }}
+{{ else -}}
 #!/usr/bin/env bash
 {{ end }}
 
--- a/.chezmoiscripts/run_onchange_after_19-install-bitwarden.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_19-install-bitwarden.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -1,16 +1,18 @@
-{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}}
+{{ if (eq .chezmoi.os "linux") -}}
 #!/usr/bin/env bash
 
 set -xe
 
-sudo apt install -y libnss3 libsecret-1-0 libxss1
-
-DOWNLOADFILE=/tmp/bitwarden.deb
 VERSION="2025.3.0"
 curl -fsSL "https://github.com/bitwarden/clients/releases/download/cli-v${VERSION}/bw-linux-${VERSION}.zip" | zcat | install -m 755 /dev/stdin $HOME/bin/bw
+
+{{ if (eq .chezmoi.osRelease.name "Ubuntu" ) -}}
+sudo apt install -y libnss3 libsecret-1-0 libxss1
+DOWNLOADFILE=/tmp/bitwarden.deb
 curl -fsSL "https://github.com/bitwarden/clients/releases/download/desktop-v${VERSION}/Bitwarden-${VERSION}-amd64.deb" > $DOWNLOADFILE
 sudo dpkg --install --skip-same-version $DOWNLOADFILE
 rm -rf $DOWNLOADFILE
+{{ end }}
 
 $HOME/bin/mise x [email protected] -- cargo install --version 1.13.2 rbw
 
--- a/.chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_22-install-devtools.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -1,10 +1,9 @@
-{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}}
+{{ if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.name "Ubuntu" ) (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix" ))) -}}
+#!/usr/bin/env bash
 {{ $packages := dict
-				 "fd"        (dict "version" "9.0.0"  "url" "https://github.com/sharkdp/fd/releases/download/v${VERSION}/fd-v${VERSION}-i686-unknown-linux-musl.tar.gz")
-				 "rg"        (dict "version" "14.0.3" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-x86_64-unknown-linux-musl.tar.gz")
-				 "delta"     (dict "version" "0.16.5" "url" "https://github.com/dandavison/delta/releases/download/${VERSION}/delta-${VERSION}-x86_64-unknown-linux-musl.tar.gz")
-				 "hyperfine" (dict "version" "1.18.0" "url" "https://github.com/sharkdp/hyperfine/releases/download/v${VERSION}/hyperfine-v${VERSION}-x86_64-unknown-linux-musl.tar.gz") -}}
-#!/usr/bin/env bash
+  "fd"        (dict "version" "10.2.0"  "url" "https://github.com/sharkdp/fd/releases/download/v${VERSION}/fd-v${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "i686") )
+  "rg"        (dict "version" "14.1.1" "url" "https://github.com/BurntSushi/ripgrep/releases/download/${VERSION}/ripgrep-${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "x86_64") )
+  "hyperfine" (dict "version" "1.19.0" "url" "https://github.com/sharkdp/hyperfine/releases/download/v${VERSION}/hyperfine-v${VERSION}-${PKG_ARCH}-unknown-linux-${PKG_LIBC}.tar.gz" "arch" ((eq .chezmoi.arch "arm64") | ternary "aarch64" "x86_64") ) -}}
 
 set -xe
 
@@ -17,9 +16,15 @@
 mkdir -p $DOWNLOAD_DIR
 pushd $DOWNLOAD_DIR
 
+{{ if (eq .chezmoi.arch "arm64") -}}
+PKG_LIBC="gnu"
+{{ else -}}
+PKG_LIBC="musl"
+{{ end }}
 {{ range keys $packages | sortAlpha }}
 {{ $meta :=  get $packages . -}}
 VERSION={{ get $meta "version" }}
+PKG_ARCH={{ get $meta "arch" }}
 echo "Downloading {{ . }} v{{ get $meta "version" }} ..."
 curl -fsSL {{ get $meta "url" }} | tar --strip-components=1 -xz
 install -m 755 $DOWNLOAD_DIR/{{ . }} $INSTALL_DIR/{{ . }}
--- a/.chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl	Thu May 08 21:56:41 2025 +0200
+++ b/.chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl	Sun May 18 16:28:58 2025 +0200
@@ -1,4 +1,4 @@
-{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+{{ if (and (eq .chezmoi.os "linux") (or (eq .chezmoi.osRelease.name "Ubuntu") (eq .chezmoi.osRelease.name "Fedora Linux Asahi Remix"))) -}}
 #!/usr/bin/env bash
 
 # helix languages config {{ include "dot_config/helix/languages.toml" | sha256sum }}
--- a/dot_tool-versions	Thu May 08 21:56:41 2025 +0200
+++ b/dot_tool-versions	Sun May 18 16:28:58 2025 +0200
@@ -1,5 +1,4 @@
 python 3.10.7
-neovim v0.9.0
 direnv 2.32.1
 rust 1.74.0
 sqlite 3.39.4