Skip to content

Commit

Permalink
feat(config): export package list
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed May 23, 2023
1 parent 6f0b2b9 commit 1c5a8bc
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chezmoi/.chezmoi.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
# {{- $cpuThreads = (output "powershell.exe" "-NoProfile" "-NonInteractive" "-Command" "(Get-CimInstance -ClassName 'Win32_Processor').NumberOfLogicalProcessors") | trim | atoi -}}
# {{- end -}}

# {{- $pkgs_minimum := "age apt-transport-https build-essential coreutils direnv file findutils fzf gh git-sizer gnupg go go-task jq locales locales-all lsb-release node nvm pip pipx procps python3-dev python3-pip python3-setuptools python3-testresources python3-venv setuptools sops stow tree tmux tzdata unzip vim yq zip zsh" -}}
# {{- $pkgs_minimal := "age apt-transport-https build-essential coreutils direnv file findutils fzf gh git-sizer gnupg go go-task jq locales locales-all lsb-release node nvm pip pipx procps python3-dev python3-pip python3-setuptools python3-testresources python3-venv setuptools sops stow tree tmux tzdata unzip vim yq zip zsh" -}}
# {{- $pkgs_full := "bazel font-fira-code font-fira-code-nerd-font google-perftools openssh-server rust sdkman serviceman webi" -}}
# {{- $pkgs_system := "containerd.io docker-ce docker-ce-cli docker-compose-plugin nvidia-container-toolkit snapd" -}}
# {{- $pkgs_gui := "gpa gpg-suite pinentry-mac xclip seahorse" -}}
# {{- $pkgs_python := "commitizen copier gitmojify mypy poethepoet pre-commit" -}}
# {{- $pkgs_user := "" -}}
# {{- $pkgs_total := $pkgs_minimum -}}
# {{- $pkgs_total := $pkgs_minimal -}}
# {{- if eq .chezmoi.os "linux" -}}
# {{- if $wsl -}}
# {{- $pkgs_system = printf "%s wslu" $pkgs_system -}}
Expand Down Expand Up @@ -918,7 +918,7 @@ data:
config_file: {{ $ngrok_config_file | quote }}
ssh_port: {{ $ngrok_ssh_port | quote }}
install_packages:
minimum: {{ $pkgs_minimum }}
minimal: {{ $pkgs_minimal }}
full: {{ $pkgs_full }}
system: {{ $pkgs_system }}
gui: {{ $pkgs_gui }}
Expand Down
Empty file added chezmoi/.template.tmpl
Empty file.
115 changes: 115 additions & 0 deletions chezmoi/dot_config/shrc/05-package-list.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#!/bin/bash
{{ if (hasKey . "packages") }}
DOTFILES_PKGS_MINIMAL=(
{{- range .packages }}
{{- if and (hasKey . "scope") ( eq .scope "minimal" ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_SYSTEM=(
{{- range .packages }}
{{- if and (hasKey . "scope") ( eq .scope "system" ) }}
{{ .name }}
{{- end }}
{{- end }}
)
{{- if eq .chezmoi.os "linux" }}
DOTFILES_PKGS_FULL=(
{{- range .packages }}
{{- if and (hasKey . "scope") ( eq .scope "full" ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_APT=(
{{- range .packages }}
{{- if and (hasKey . "apt") ( .apt ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_SNAP=(
{{- range .packages }}
{{- if and (hasKey . "snap") ( .snap ) }}
{{ .name }}
{{- end }}
{{- end }}
)
{{- end }}
{{- if eq .chezmoi.os "darwin" }}
DOTFILES_PKGS_BREW=(
{{- range .packages }}
{{- if and (hasKey . "brew") ( .brew ) }}
{{ .name }}
{{- end }}
{{- end }}
)
{{- end }}
DOTFILES_PKGS_SCRIPT=(
{{- range .packages }}
{{- if and (hasKey . "script") ( .script ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_WEBI=(
{{- range .packages }}
{{- if and (hasKey . "webi") ( .webi ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_GO=(
{{- range .packages }}
{{- if and (hasKey . "go") ( .go ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_PIP=(
{{- range .packages }}
{{- if and (hasKey . "pip") ( .pip ) }}
{{ .name }}
{{- end }}
{{- end }}
)
DOTFILES_PKGS_PIPX=(
{{- range .packages }}
{{- if and (hasKey . "pipx") ( .pipx ) }}
{{ .name }}
{{- end }}
{{- end }}
)
{{- else }}
DOTFILES_PKGS_MINIMAL=()
DOTFILES_PKGS_SYSTEM=()
{{- if eq .chezmoi.os "linux" }}
DOTFILES_PKGS_FULL=()
DOTFILES_PKGS_APT=()
DOTFILES_PKGS_SNAP=()
{{- end }}
{{- if eq .chezmoi.os "darwin" }}
DOTFILES_PKGS_BREW=()
{{- end }}
DOTFILES_PKGS_SCRIPT=()
DOTFILES_PKGS_WEBI=()
DOTFILES_PKGS_GO=()
DOTFILES_PKGS_PIP=()
DOTFILES_PKGS_PIPX=()
{{- end }}
export DOTFILES_PKGS_MINIMAL
export DOTFILES_PKGS_SYSTEM
{{- if eq .chezmoi.os "linux" }}
export DOTFILES_PKGS_FULL
export DOTFILES_PKGS_APT
export DOTFILES_PKGS_SNAP
{{- end }}
{{- if eq .chezmoi.os "darwin" }}
export DOTFILES_PKGS_BREW
{{- end }}
export DOTFILES_PKGS_SCRIPT
export DOTFILES_PKGS_WEBI
export DOTFILES_PKGS_GO
export DOTFILES_PKGS_PIP
export DOTFILES_PKGS_PIPX

0 comments on commit 1c5a8bc

Please sign in to comment.