Update dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_11-install-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_11-install-fedora-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_11-install-debian-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_11-install-darwin-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_11-install-archlinux-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages
Deleted dotfiles/.local/share/chezmoi/home/run_update, dotfiles/.local/share/chezmoi/home/run_once_provision
This commit is contained in:
parent
77a227d420
commit
a0efac463d
15 changed files with 117 additions and 74 deletions
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "arch" }}
|
||||
{{ $supportedManagers := (list "flatpak" "snap" "whalebrew" "pacman" "brew" "yay" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
|
@ -0,0 +1,16 @@
|
|||
{{- if eq .host.distro.id "centos" }}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Required for styled logging
|
||||
{{- includeTemplate "universal/logg" }}
|
||||
|
||||
{{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }}
|
||||
# TODO - Add Python dependencies like in ubuntu/archlinux
|
||||
|
||||
logg 'Installing common dependencies using dnf'
|
||||
logg "Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}"
|
||||
|
||||
### Install base dependencies
|
||||
sudo dnf install -y {{ $packages | sortAlpha | uniq | join " " -}}
|
||||
|
||||
{{- end -}}
|
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "centos" }}
|
||||
{{ $supportedManagers := (list "flatpak" "snap" "whalebrew" "dnf" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
|
@ -0,0 +1,13 @@
|
|||
{{- if eq .host.distro.id "darwin" }}
|
||||
{{- $supportedManagers := (list "whalebrew" "brew" "port" "go" "cargo" "npm" "pipx" "gem" "cask" "binary") }}
|
||||
{{- $packageMap := (get .installerMap $packageName) }}
|
||||
{{- if (hasKey $packageMap "_deps") }}
|
||||
{{- $deps := (get $packageMap "_deps") }}
|
||||
{{- range index $deps }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Examples of /etc/os-release values https://gist.github.com/natefoo/814c5bf936922dad97ff
|
||||
# Example fromJson with include from file https://github.com/twpayne/chezmoi/issues/1369
|
||||
{{- end -}}
|
|
@ -0,0 +1,38 @@
|
|||
{{- if eq .host.distro.id "ubuntu" }}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Required for styled logging
|
||||
{{- includeTemplate "universal/logg" }}
|
||||
|
||||
{{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) -}}
|
||||
{{- $pyenvDependencies := list
|
||||
"make"
|
||||
"build-essential"
|
||||
"libssl-dev"
|
||||
"zlib1g-dev"
|
||||
"libbz2-dev"
|
||||
"libreadline-dev"
|
||||
"libsqlite3-dev"
|
||||
"wget"
|
||||
"curl"
|
||||
"llvm"
|
||||
"libncursesw5-dev"
|
||||
"xz-utils"
|
||||
"tk-dev"
|
||||
"libxml2-dev"
|
||||
"libxmlsec1-dev"
|
||||
"libffi-dev"
|
||||
"liblzma-dev"
|
||||
-}}
|
||||
{{- if .toolchains.python }}
|
||||
{{- $packages = concat $packages $pyenvDependencies -}}
|
||||
{{- end }}
|
||||
|
||||
source "$HOME/.config/shell/exports"
|
||||
|
||||
logg 'Installing common dependencies using apt-get'
|
||||
logg "Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}"
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends {{ $packages | sortAlpha | uniq | join " " -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,5 @@
|
|||
{{- if eq .host.distro.id "debian" }}
|
||||
{{ $supportedManagers := (list "flatpak" "snap" "whalebrew" "apt" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{{- if eq .host.distro.id "fedora" }}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Required for styled logging
|
||||
{{- includeTemplate "universal/logg" }}
|
||||
|
||||
{{- $packages := splitList " " (includeTemplate "universal/essential-packages" .) }}
|
||||
# TODO - Add Python dependencies like in ubuntu/archlinux
|
||||
|
||||
logg 'Installing common dependencies using dnf'
|
||||
logg "Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}"
|
||||
|
||||
### Install base dependencies
|
||||
sudo dnf install -y {{ $packages | sortAlpha | uniq | join " " -}}
|
||||
|
||||
{{- end -}}
|
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "fedora" }}
|
||||
{{ $supportedManagers := (list "flatpak" "snap" "whalebrew" "dnf" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "opensuse" }}
|
||||
{{ $supportedManagers := (list "whalebrew" "pkg" "go" "cargo" "npm" "gem") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "opensuse" }}
|
||||
{{ $supportedManagers := (list "flatpak" "snap" "whalebrew" "zypper" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
|
@ -0,0 +1,5 @@
|
|||
{{- if eq .host.distro.id "ubuntu" }}
|
||||
{{- $supportedManagers := (list "flatpak" "snap" "whalebrew" "apt" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
#!/usr/bin/env bash
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{{- if eq .host.distro.id "ubuntu" }}
|
||||
{{ $supportedManagers := (list "whalebrew" "choco" "scoop" "winget" "go" "cargo" "npm" "pipx" "gem" "binary") }}
|
||||
|
||||
{{- end -}}
|
|
@ -1,45 +0,0 @@
|
|||
#!/usr/bin/env zx
|
||||
# Examples of /etc/os-release values https://gist.github.com/natefoo/814c5bf936922dad97ff
|
||||
# Example fromJson with include from file https://github.com/twpayne/chezmoi/issues/1369
|
||||
|
||||
echo "Run once provision hook"
|
||||
|
||||
{{ $packageMap := (get .installerMap $packageName) }}
|
||||
{{ if (hasKey $packageMap "_deps") }}
|
||||
{{ $deps := (get $packageMap "_deps") }}
|
||||
{{ range index $deps }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (eq .chezmoi.os "windows") }}
|
||||
{{ $managers := (list "whalebrew" "choco" "scoop" "winget" "go" "cargo" "npm" "pipx" "gem" "binary") }}
|
||||
|
||||
{{ else if (eq .chezmoi.os "darwin") }}
|
||||
{{ $managers := (list "whalebrew" "brew" "port" "go" "cargo" "npm" "pipx" "gem" "cask" "binary") }}
|
||||
|
||||
{{ else if (eq .chezmoi.os "freebsd") }}
|
||||
{{ $managers := (list "whalebrew" "pkg" "go" "cargo" "npm" "gem") }}
|
||||
|
||||
{{ else if (eq .chezmoi.os "android") }}
|
||||
{{ $managers := (list "apk") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "arch") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "pacman" "brew" "yay" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "centos") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "dnf" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "debian") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "apt" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "fedora") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "dnf" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "opensuse") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "zypper" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ else if and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease "ubuntu") }}
|
||||
{{ $managers := (list "flatpak" "snap" "whalebrew" "apt" "brew" "go" "cargo" "npm" "pipx" "gem" "appimage" "binary") }}
|
||||
|
||||
{{ end }}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{{ if or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin") }}
|
||||
#!/bin/sh
|
||||
|
||||
echo "Run update hook"
|
||||
|
||||
rm -rf ~/AppData
|
||||
{{ if or (eq .chezmoi.os "linux") }}
|
||||
rm -rf ~/Library
|
||||
{{ end }}
|
||||
|
||||
if [ -d "$HOME/.local/shared-common" ]; then
|
||||
cp ~/.local/shared-common/Taskfile.yml ~/.local/Taskfile.yml
|
||||
sed -i 's/\.\/\.config\/taskfiles/taskfiles/g' ~/.local/Taskfile.yml
|
||||
ln -s ~/.local/taskfiles ~/.local/shared-common/common/.config/taskfiles
|
||||
fi
|
||||
|
||||
{{ if (eq .chezmoi.os "darwin") }}
|
||||
if command -v gsed > /dev/null; then
|
||||
gsed -i 's/\.\/\.config\/taskfiles/taskfiles/g' ~/.local/Taskfile.yml
|
||||
else
|
||||
echo "Unable to fix ~/.local/Taskfile.yml because gsed GNU compatibility tool is not installed."
|
||||
fi
|
||||
{{ end }}
|
||||
|
||||
{{ else if chezmoi.os "windows" }}
|
||||
|
||||
Remove-Item -LiteralPath "$env:HOMEPATH\Library" -Force -Recurse
|
||||
|
||||
{{ end }}
|
Loading…
Reference in a new issue