mirror of
https://github.com/reonokiy/dotfiles.git
synced 2025-06-14 21:56:47 +02:00
add auto-install scripts for fedora39
This commit is contained in:
parent
2174f5cd8f
commit
ee2bf02772
2 changed files with 54 additions and 0 deletions
14
.chezmoidata/packages.toml
Normal file
14
.chezmoidata/packages.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
[packages.fedora39]
|
||||
dnf.pkgs = [
|
||||
"eza",
|
||||
"thefuck",
|
||||
"micromamba",
|
||||
"zoxide"
|
||||
]
|
||||
brew.pkgs = [
|
||||
"atuin",
|
||||
"fnm",
|
||||
"yazi",
|
||||
"zsh-syntax-highlighting",
|
||||
"zsh-autosuggestions"
|
||||
]
|
40
.chezmoiscripts/run_onchange_fedora-install-pkgs.sh.tmpl
Normal file
40
.chezmoiscripts/run_onchange_fedora-install-pkgs.sh.tmpl
Normal file
|
@ -0,0 +1,40 @@
|
|||
{{- if (and (and (eq .chezmoi.os "linux")
|
||||
(eq .chezmoi.osRelease.id "fedora"))
|
||||
(eq .chezmoi.osRelease.versionID "39")) -}}
|
||||
#!/bin/bash
|
||||
# fedora39 packages hash: {{ .packages.fedora39 | quote | sha256sum }}
|
||||
|
||||
bold=$(tput bold)
|
||||
normal=$(tput sgr0)
|
||||
function custom_echo() {
|
||||
echo -e "${bold}$1${normal}"
|
||||
}
|
||||
|
||||
{{ if gt (len .packages.fedora39.dnf.pkgs) 0 -}}
|
||||
# Install dnf packages
|
||||
custom_echo "[Info] Installing dnf packages... Please input your password if requested."
|
||||
sudo dnf install {{ range .packages.fedora39.dnf.pkgs }} {{- . | quote }} {{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if gt (len .packages.fedora39.brew.pkgs) 0 -}}
|
||||
# Check if Homebrew is installed
|
||||
if ! command -v brew &> /dev/null; then
|
||||
custom_echo "[Info] Homebrew is not installed. Installing..."
|
||||
# Install Homebrew
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
# Check if installation was successful
|
||||
if ! command -v brew &> /dev/null; then
|
||||
custom_echo "[Error] Failed to install Homebrew. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
custom_echo "[Success] Homebrew has been successfully installed."
|
||||
else
|
||||
custom_echo "[Info] Homebrew is already installed."
|
||||
fi
|
||||
|
||||
# Install Homebrew packages
|
||||
custom_echo "[Info] Installing homebrew packages..."
|
||||
brew install {{ range .packages.fedora39.brew.pkgs }} {{- . | quote }} {{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue