diff --git a/lazy.ansible/.manala/Makefile.tmpl b/lazy.ansible/.manala/Makefile.tmpl index c5b99c31..49f3cafb 100644 --- a/lazy.ansible/.manala/Makefile.tmpl +++ b/lazy.ansible/.manala/Makefile.tmpl @@ -54,7 +54,7 @@ sh: else \ $(call manala_docker_command, \ $(if $(PORT),--publish $(PORT)), \ - ) bash --login ; \ + ) zsh --login ; \ fi .PHONY: sh diff --git a/lazy.ansible/.manala/docker/Dockerfile.tmpl b/lazy.ansible/.manala/docker/Dockerfile.tmpl index 0cfd6a8e..ec30bbc5 100644 --- a/lazy.ansible/.manala/docker/Dockerfile.tmpl +++ b/lazy.ansible/.manala/docker/Dockerfile.tmpl @@ -29,7 +29,6 @@ RUN \ apt-get --quiet update \ && apt-get --quiet --yes --purge --autoremove upgrade \ && apt-get --quiet --yes --no-install-recommends --verbose-versions install \ - bash-completion \ bzip2 \ ca-certificates \ curl \ @@ -43,9 +42,10 @@ RUN \ socat \ sudo \ vim \ + zsh \ # User && addgroup --gid ${MANALA_GROUP_ID} lazy \ - && adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ + && adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ && install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \ && echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \ # Gosu @@ -68,10 +68,12 @@ RUN \ && curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \ --output /usr/local/bin/yq \ && chmod +x /usr/local/bin/yq \ - # Bash completion - && install --verbose --mode 0755 --directory /etc/bash_completion.d \ - # Oh My Bash - && git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \ + # Oh My Zsh + && git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh \ + # See: https://github.com/ohmyzsh/ohmyzsh/issues/11995 + && git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions \ + && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting \ + && echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv \ # Clean && rm -rf /var/lib/apt/lists/* @@ -177,14 +179,27 @@ RUN \ RUN \ pipx install --pip-args="--no-cache-dir" \ molecule=={{ $molecule.version }} \ - && _MOLECULE_COMPLETE=bash_source molecule > /etc/bash_completion.d/molecule \ {{- if $molecule.dependencies }} && pipx inject --pip-args="--no-cache-dir" molecule \ {{- range $i, $dependency := $molecule.dependencies }} - {{- if $i }} \{{- end }} - {{ $dependency }} + {{ $dependency }} \ {{- end }} {{- end }} + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12757 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/molecule \ + && printf "\ +if (( ! $+commands[molecule] )); then\n\ + return\n\ +fi\n\ +if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_molecule\" ]]; then\n\ + _MOLECULE_COMPLETE=zsh_source molecule | tee \"\$ZSH_CACHE_DIR/completions/_molecule\" >/dev/null\n\ + source \"\$ZSH_CACHE_DIR/completions/_molecule\"\n\ +else\n\ + source \"\$ZSH_CACHE_DIR/completions/_molecule\"\n\ + _MOLECULE_COMPLETE=zsh_source molecule | tee \"\$ZSH_CACHE_DIR/completions/_molecule\" >/dev/null &|\n\ +fi\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/molecule/molecule.plugin.zsh {{ end -}} @@ -194,17 +209,11 @@ RUN \ RUN \ curl -sSLf "https://releases.hashicorp.com/terraform/{{ $terraform.version }}/terraform_{{ $terraform.version }}_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.zip" \ | bsdtar -xvf - -C /usr/local/bin \ - && chmod +x /usr/local/bin/terraform \ - # Bash completion - && echo "complete -C /usr/local/bin/terraform terraform" > /etc/bash_completion.d/terraform \ - # Bash aliases - && printf "alias tf='terraform'\n\ -complete -C /usr/local/bin/terraform tf\n\ -" > /etc/profile.d/terraform.sh + && chmod +x /usr/local/bin/terraform {{ end -}} # Run COPY docker/entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] -CMD ["bash"] +CMD ["zsh"] diff --git a/lazy.ansible/.manala/etc/profile.d/oh-my-bash.sh.tmpl b/lazy.ansible/.manala/etc/profile.d/oh-my-bash.sh.tmpl deleted file mode 100644 index fe240f8f..00000000 --- a/lazy.ansible/.manala/etc/profile.d/oh-my-bash.sh.tmpl +++ /dev/null @@ -1,148 +0,0 @@ -# Enable the subsequent settings only in interactive sessions -case $- in - *i*) ;; - *) return;; -esac - -# Path to your oh-my-bash installation. -export OSH=/usr/local/share/oh-my-bash - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-bash is loaded. -OSH_THEME="font" - -# If you set OSH_THEME to "random", you can ignore themes you don't like. -# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo") - -# Uncomment the following line to use case-sensitive completion. -# OMB_CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# OMB_HYPHEN_SENSITIVE="false" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_OSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you don't want the repository to be considered dirty -# if there are untracked files. -# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true" - -# Uncomment the following line if you want to completely ignore the presence -# of untracked files in the repository. -# SCM_GIT_IGNORE_UNTRACKED="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. One of the following values can -# be used to specify the timestamp format. -# * 'mm/dd/yyyy' # mm/dd/yyyy + time -# * 'dd.mm.yyyy' # dd.mm.yyyy + time -# * 'yyyy-mm-dd' # yyyy-mm-dd + time -# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors -# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors -# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors -# If not set, the default value is 'yyyy-mm-dd'. -# HIST_STAMPS='yyyy-mm-dd' - -# Uncomment the following line if you do not want OMB to overwrite the existing -# aliases by the default OMB aliases defined in lib/*.sh -# OMB_DEFAULT_ALIASES="check" - -# Would you like to use another custom folder than $OSH/custom? -# OSH_CUSTOM=/path/to/new-custom-folder - -# To disable the uses of "sudo" by oh-my-bash, please set "false" to -# this variable. The default behavior for the empty value is "true". -OMB_USE_SUDO=true - -# To enable/disable display of Python virtualenv and condaenv -# OMB_PROMPT_SHOW_PYTHON_VENV=true # enable -# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable - -# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) -# Custom completions may be added to ~/.oh-my-bash/custom/completions/ -# Example format: completions=(ssh git bundler gem pip pip3) -# Add wisely, as too many completions slow down shell startup. -completions=( - git - ssh -) - -# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*) -# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/ -# Example format: aliases=(vagrant composer git-avh) -# Add wisely, as too many aliases slow down shell startup. -aliases=( - general - ls -) - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - git - ansible -) - -# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: -# if [ "$DISPLAY" ] || [ "$SSH" ]; then -# plugins+=(tmux-autoattach) -# fi - -source "$OSH"/oh-my-bash.sh - -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-bash libs, -# plugins, and themes. Aliases can be placed here, though oh-my-bash -# users are encouraged to define aliases within the OSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias bashconfig="mate ~/.bashrc" -# alias ohmybash="mate ~/.oh-my-bash" - -# Disable full path print after cd into a directory -# See: https://github.com/ohmybash/oh-my-bash/issues/201 -unset CDPATH diff --git a/lazy.ansible/.manala/etc/profile.d/zz-direnv.sh.tmpl b/lazy.ansible/.manala/etc/profile.d/zz-direnv.sh.tmpl deleted file mode 100644 index 24ea5737..00000000 --- a/lazy.ansible/.manala/etc/profile.d/zz-direnv.sh.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -eval "$(direnv hook bash)" - -# Config directory -export DIRENV_CONFIG=/etc/direnv - -# Faint output -# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv -export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m' diff --git a/lazy.ansible/.manala/etc/profile.d/message.sh.tmpl b/lazy.ansible/.manala/etc/zsh/.zlogin.tmpl similarity index 100% rename from lazy.ansible/.manala/etc/profile.d/message.sh.tmpl rename to lazy.ansible/.manala/etc/zsh/.zlogin.tmpl diff --git a/lazy.ansible/.manala/etc/zsh/.zshrc.tmpl b/lazy.ansible/.manala/etc/zsh/.zshrc.tmpl new file mode 100644 index 00000000..3d64c410 --- /dev/null +++ b/lazy.ansible/.manala/etc/zsh/.zshrc.tmpl @@ -0,0 +1,119 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH=/usr/local/share/oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time Oh My Zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + direnv + zsh-autosuggestions + zsh-syntax-highlighting + ansible +{{- if .Vars.system.docker }} + docker +{{- end }} +{{- if .Vars.system.molecule }} + molecule +{{- end }} +{{- if .Vars.system.terraform }} + terraform +{{- end }} +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/lazy.ansible/test/goss.yaml b/lazy.ansible/test/goss.yaml index b08ab95d..875c0dbe 100644 --- a/lazy.ansible/test/goss.yaml +++ b/lazy.ansible/test/goss.yaml @@ -26,7 +26,7 @@ user: exists: true groups: - lazy - shell: /bin/bash + shell: /bin/zsh file: # Base diff --git a/lazy.kubernetes/.manala/Makefile.tmpl b/lazy.kubernetes/.manala/Makefile.tmpl index c5b99c31..49f3cafb 100644 --- a/lazy.kubernetes/.manala/Makefile.tmpl +++ b/lazy.kubernetes/.manala/Makefile.tmpl @@ -54,7 +54,7 @@ sh: else \ $(call manala_docker_command, \ $(if $(PORT),--publish $(PORT)), \ - ) bash --login ; \ + ) zsh --login ; \ fi .PHONY: sh diff --git a/lazy.kubernetes/.manala/docker/Dockerfile.tmpl b/lazy.kubernetes/.manala/docker/Dockerfile.tmpl index 0da89026..bdb2791a 100644 --- a/lazy.kubernetes/.manala/docker/Dockerfile.tmpl +++ b/lazy.kubernetes/.manala/docker/Dockerfile.tmpl @@ -29,7 +29,6 @@ RUN \ apt-get --quiet update \ && apt-get --quiet --yes --purge --autoremove upgrade \ && apt-get --quiet --yes --no-install-recommends --verbose-versions install \ - bash-completion \ bzip2 \ ca-certificates \ curl \ @@ -43,9 +42,10 @@ RUN \ socat \ sudo \ vim \ + zsh \ # User && addgroup --gid ${MANALA_GROUP_ID} lazy \ - && adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ + && adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ && install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \ && echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \ # Gosu @@ -68,10 +68,12 @@ RUN \ && curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \ --output /usr/local/bin/yq \ && chmod +x /usr/local/bin/yq \ - # Bash completion - && install --verbose --mode 0755 --directory /etc/bash_completion.d \ - # Oh My Bash - && git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \ + # Oh My Zsh + && git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh \ + # See: https://github.com/ohmyzsh/ohmyzsh/issues/11995 + && git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions \ + && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting \ + && echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv \ # Clean && rm -rf /var/lib/apt/lists/* @@ -136,14 +138,7 @@ RUN \ {{ $kubectl := .Vars.system.kubectl -}} RUN \ curl -sSLf "https://dl.k8s.io/v{{ $kubectl.version }}/kubernetes-client-linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.tar.gz" \ - | bsdtar -xvf - -C /usr/local/bin --strip-components=3 kubernetes/client/bin/kubectl \ - # Bash completion - && kubectl completion bash > /etc/bash_completion.d/kubectl \ - # Bash aliases - && printf "\ -alias k='kubectl'\n\ -complete -F __start_kubectl k\n\ -" > /etc/profile.d/kubectl.sh + | bsdtar -xvf - -C /usr/local/bin --strip-components=3 kubernetes/client/bin/kubectl {{ $helm := .Vars.system.helm -}} {{ if $helm.version -}} @@ -151,14 +146,7 @@ complete -F __start_kubectl k\n\ ENV HELM_PLUGINS="/usr/local/share/helm/plugins" RUN \ curl -sSLf "https://get.helm.sh/helm-v{{ $helm.version }}-linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.tar.gz" \ - | bsdtar -xvf - -C /usr/local/bin --strip-components=1 "linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}/helm" \ - # Bash completion - && helm completion bash > /etc/bash_completion.d/helm \ - # Bash aliases - && printf "\ -alias h='helm'\n\ -complete -F __start_helm h\n\ -" > /etc/profile.d/helm.sh + | bsdtar -xvf - -C /usr/local/bin --strip-components=1 "linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}/helm" {{- if $helm.plugins }} \ # Plugins {{- range $i, $plugin := $helm.plugins }} @@ -179,15 +167,23 @@ ENV HELMFILE_UPGRADE_NOTICE_DISABLED="1" RUN \ curl -sSLf "https://github.com/helmfile/helmfile/releases/download/v{{ $helmfile.version }}/helmfile_{{ $helmfile.version }}_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.tar.gz" \ | bsdtar -xvf - -C /usr/local/bin helmfile \ - # Bash completion - && helmfile completion bash > /etc/bash_completion.d/helmfile \ - # Bash aliases + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12750 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/helmfile \ && printf "\ +if (( ! $+commands[helmfile] )); then\n\ + return\n\ +fi\n\ +if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_helmfile\" ]]; then\n\ + helmfile completion zsh | tee \"\$ZSH_CACHE_DIR/completions/_helmfile\" >/dev/null\n\ + source \"\$ZSH_CACHE_DIR/completions/_helmfile\"\n\ +else\n\ + source \"\$ZSH_CACHE_DIR/completions/_helmfile\"\n\ + helmfile completion zsh | tee \"\$ZSH_CACHE_DIR/completions/_helmfile\" >/dev/null &|\n\ +fi\n\ alias hf='helmfile'\n\ -complete -F __start_helmfile hf\n\ alias hfi='helmfile --interactive'\n\ -complete -F __start_helmfile hfi\n\ -" > /etc/profile.d/helmfile.sh +" > /usr/local/share/oh-my-zsh/custom/plugins/helmfile/helmfile.plugin.zsh {{ end -}} @@ -206,8 +202,21 @@ RUN \ RUN \ curl -sSLf "https://github.com/stern/stern/releases/download/v{{ $stern.version }}/stern_{{ $stern.version }}_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.tar.gz" \ | bsdtar -xvf - -C /usr/local/bin stern \ - # Bash completion - && stern --completion=bash > /etc/bash_completion.d/stern + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12751 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/stern \ + && printf "\ +if (( ! $+commands[stern] )); then\n\ + return\n\ +fi\n\ +if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_stern\" ]]; then\n\ + stern --completion zsh | tee \"\$ZSH_CACHE_DIR/completions/_stern\" >/dev/null\n\ + source \"\$ZSH_CACHE_DIR/completions/_stern\"\n\ +else\n\ + source \"\$ZSH_CACHE_DIR/completions/_stern\"\n\ + stern --completion zsh | tee \"\$ZSH_CACHE_DIR/completions/_stern\" >/dev/null &|\n\ +fi\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/stern/stern.plugin.zsh {{ end -}} @@ -227,8 +236,15 @@ RUN \ curl -sSLf "https://releases.hashicorp.com/vault/{{ $vault.version }}/vault_{{ $vault.version }}_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.zip" \ | bsdtar -xvf - -C /usr/local/bin \ && chmod +x /usr/local/bin/vault \ - # Bash completion - && echo "complete -C /usr/local/bin/vault vault" > /etc/bash_completion.d/vault + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12753 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/vault \ + && printf "\ +if (( ! $+commands[helmfile] )); then\n\ + return\n\ +fi\n\ +complete -o nospace -C vault vault\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/vault/vault.plugin.zsh {{ end -}} @@ -239,8 +255,21 @@ RUN \ curl -sSLf "https://downloads.rclone.org/v{{ $rclone.version }}/rclone-v{{ $rclone.version }}-linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}.zip" \ | bsdtar -xvf - -C /usr/local/bin --strip-components=1 "rclone-v{{ $rclone.version }}-linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}/rclone" \ && chmod +x /usr/local/bin/rclone \ - # Bash completion - && rclone genautocomplete bash /etc/bash_completion.d/rclone + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12754 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/rclone \ + && printf "\ +if (( ! $+commands[rclone] )); then\n\ + return\n\ +fi\n\ +if [[ ! -f \"\$ZSH_CACHE_DIR/completions/_rclone\" ]]; then\n\ + rclone completion zsh - | tee \"\$ZSH_CACHE_DIR/completions/_rclone\" >/dev/null\n\ + source \"\$ZSH_CACHE_DIR/completions/_rclone\"\n\ +else\n\ + source \"\$ZSH_CACHE_DIR/completions/_rclone\"\n\ + rclone completion zsh - | tee \"\$ZSH_CACHE_DIR/completions/_rclone\" >/dev/null &|\n\ +fi\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/rclone/rclone.plugin.zsh {{ end -}} @@ -301,8 +330,23 @@ RUN \ curl -sSLf "https://github.com/scaleway/scaleway-cli/releases/download/v{{ $scw.version }}/scaleway-cli_{{ $scw.version }}_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \ --output /usr/local/bin/scw \ && chmod +x /usr/local/bin/scw \ - # Bash completion - && scw autocomplete script shell=/bin/bash > /etc/bash_completion.d/scw + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12755 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/scw \ + && printf "\ +if (( ! $+commands[scw] )); then\n\ + return\n\ +fi\n\ +_scw () {\n\ + output=(\$(scw autocomplete complete zsh -- \${CURRENT} \${words}))\n\ + opts=('-S' ' ')\n\ + if [[ \$output == *= ]]; then\n\ + opts=('-S' '')\n\ + fi\n\ + compadd \"\${opts[@]}\" -- \"\${output[@]}\"\n\ +}\n\ +compdef _scw scw\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/scw/scw.plugin.zsh {{ end -}} @@ -312,7 +356,31 @@ RUN \ RUN \ curl -sSLf "https://github.com/mozilla/sops/releases/download/v{{ $sops.version }}/sops-v{{ $sops.version }}.linux.{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \ --output /usr/local/bin/sops \ - && chmod +x /usr/local/bin/sops + && chmod +x /usr/local/bin/sops \ + # Oh My Zsh plugin + # See: https://github.com/ohmyzsh/ohmyzsh/pull/12757 + && mkdir /usr/local/share/oh-my-zsh/custom/plugins/sops \ + && printf "\ +if (( ! $+commands[sops] )); then\n\ + return\n\ +fi\n\ +_sops() {\n\ + local -a opts\n\ + local cur\n\ + cur=\${words[-1]}\n\ + if [[ \"\$cur\" == \"-\"* ]]; then\n\ + opts=(\"\${(@f)\$(\${words[@]:0:#words[@]-1} \${cur} --generate-shell-completion)}\")\n\ + else\n\ + opts=(\"\${(@f)\$(\${words[@]:0:#words[@]-1} --generate-shell-completion)}\")\n\ + fi\n\ + if [[ \"\${opts[1]}\" != \"\" ]]; then\n\ + _describe 'values' opts\n\ + else\n\ + _files\n\ + fi\n\ +}\n\ +compdef _sops sops\n\ +" > /usr/local/share/oh-my-zsh/custom/plugins/sops/sops.plugin.zsh {{ end -}} @@ -348,18 +416,7 @@ RUN \ && apt-get --quiet --yes --no-install-recommends --verbose-versions install \ python3 \ && curl -sSLf "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-{{ $gcloud.version }}-linux-{{ include "arch_map" (dict "amd64" "x86_64" "arm64" "arm") }}.tar.gz" \ - | bsdtar -xf - -C /usr/local \ - # Profile - && touch /etc/profile.d/gcloud.sh \ - && /usr/local/google-cloud-sdk/install.sh \ - --rc-path /etc/profile.d/gcloud.sh \ - --command-completion true \ - --path-update true \ - {{- if $gcloud.components }} - --additional-components {{ $gcloud.components | join " " }} \ - {{- end }} - --quiet \ - && rm -rf /etc/profile.d/gcloud.sh.backup \ + | bsdtar -xf - -C /usr/local/share \ # Clean && rm -rf /var/lib/apt/lists/* @@ -387,4 +444,4 @@ RUN \ # Run COPY docker/entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] -CMD ["bash"] +CMD ["zsh"] diff --git a/lazy.kubernetes/.manala/etc/profile.d/oh-my-bash.sh.tmpl b/lazy.kubernetes/.manala/etc/profile.d/oh-my-bash.sh.tmpl deleted file mode 100644 index 43cfcc57..00000000 --- a/lazy.kubernetes/.manala/etc/profile.d/oh-my-bash.sh.tmpl +++ /dev/null @@ -1,146 +0,0 @@ -# Enable the subsequent settings only in interactive sessions -case $- in - *i*) ;; - *) return;; -esac - -# Path to your oh-my-bash installation. -export OSH=/usr/local/share/oh-my-bash - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-bash is loaded. -OSH_THEME="font" - -# If you set OSH_THEME to "random", you can ignore themes you don't like. -# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo") - -# Uncomment the following line to use case-sensitive completion. -# OMB_CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# OMB_HYPHEN_SENSITIVE="false" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_OSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you don't want the repository to be considered dirty -# if there are untracked files. -# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true" - -# Uncomment the following line if you want to completely ignore the presence -# of untracked files in the repository. -# SCM_GIT_IGNORE_UNTRACKED="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. One of the following values can -# be used to specify the timestamp format. -# * 'mm/dd/yyyy' # mm/dd/yyyy + time -# * 'dd.mm.yyyy' # dd.mm.yyyy + time -# * 'yyyy-mm-dd' # yyyy-mm-dd + time -# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors -# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors -# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors -# If not set, the default value is 'yyyy-mm-dd'. -# HIST_STAMPS='yyyy-mm-dd' - -# Uncomment the following line if you do not want OMB to overwrite the existing -# aliases by the default OMB aliases defined in lib/*.sh -# OMB_DEFAULT_ALIASES="check" - -# Would you like to use another custom folder than $OSH/custom? -# OSH_CUSTOM=/path/to/new-custom-folder - -# To disable the uses of "sudo" by oh-my-bash, please set "false" to -# this variable. The default behavior for the empty value is "true". -OMB_USE_SUDO=true - -# To enable/disable display of Python virtualenv and condaenv -# OMB_PROMPT_SHOW_PYTHON_VENV=true # enable -# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable - -# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) -# Custom completions may be added to ~/.oh-my-bash/custom/completions/ -# Example format: completions=(ssh git bundler gem pip pip3) -# Add wisely, as too many completions slow down shell startup. -completions=( - git -) - -# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*) -# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/ -# Example format: aliases=(vagrant composer git-avh) -# Add wisely, as too many aliases slow down shell startup. -aliases=( - general - ls -) - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - git -) - -# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: -# if [ "$DISPLAY" ] || [ "$SSH" ]; then -# plugins+=(tmux-autoattach) -# fi - -source "$OSH"/oh-my-bash.sh - -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-bash libs, -# plugins, and themes. Aliases can be placed here, though oh-my-bash -# users are encouraged to define aliases within the OSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias bashconfig="mate ~/.bashrc" -# alias ohmybash="mate ~/.oh-my-bash" - -# Disable full path print after cd into a directory -# See: https://github.com/ohmybash/oh-my-bash/issues/201 -unset CDPATH diff --git a/lazy.kubernetes/.manala/etc/profile.d/zz-direnv.sh.tmpl b/lazy.kubernetes/.manala/etc/profile.d/zz-direnv.sh.tmpl deleted file mode 100644 index 24ea5737..00000000 --- a/lazy.kubernetes/.manala/etc/profile.d/zz-direnv.sh.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -eval "$(direnv hook bash)" - -# Config directory -export DIRENV_CONFIG=/etc/direnv - -# Faint output -# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv -export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m' diff --git a/lazy.kubernetes/.manala/etc/profile.d/message.sh.tmpl b/lazy.kubernetes/.manala/etc/zsh/.zlogin.tmpl similarity index 100% rename from lazy.kubernetes/.manala/etc/profile.d/message.sh.tmpl rename to lazy.kubernetes/.manala/etc/zsh/.zlogin.tmpl diff --git a/lazy.kubernetes/.manala/etc/zsh/.zshrc.tmpl b/lazy.kubernetes/.manala/etc/zsh/.zshrc.tmpl new file mode 100644 index 00000000..d0b74e02 --- /dev/null +++ b/lazy.kubernetes/.manala/etc/zsh/.zshrc.tmpl @@ -0,0 +1,146 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH=/usr/local/share/oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time Oh My Zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + direnv + zsh-autosuggestions + zsh-syntax-highlighting + kubectl +{{- if .Vars.system.docker }} + docker +{{- end }} +{{- if .Vars.system.helm.version }} + helm +{{- end }} +{{- if .Vars.system.helmfile.version }} + helmfile +{{- end }} +{{- if .Vars.system.k9s.version }} + k9s +{{- end }} +{{- if .Vars.system.stern.version }} + stern +{{- end }} +{{- if .Vars.system.vault.version }} + vault +{{- end }} +{{- if .Vars.system.rclone.version }} + rclone +{{- end }} +{{- if .Vars.system.scw.version }} + scw +{{- end }} +{{- if .Vars.system.sops.version }} + sops +{{- end }} +{{- if .Vars.system.aws.version }} + aws +{{- end }} +{{- if .Vars.system.gcloud.version }} + gcloud +{{- end }} +{{- if .Vars.system.argocd.version }} + argocd +{{- end }} +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/lazy.kubernetes/test/goss.yaml b/lazy.kubernetes/test/goss.yaml index 318fd46a..a07932b0 100644 --- a/lazy.kubernetes/test/goss.yaml +++ b/lazy.kubernetes/test/goss.yaml @@ -17,7 +17,7 @@ user: exists: true groups: - lazy - shell: /bin/bash + shell: /bin/zsh file: # Base diff --git a/lazy.symfony/.manala/Makefile.tmpl b/lazy.symfony/.manala/Makefile.tmpl index b447fd8a..3aa29ac9 100644 --- a/lazy.symfony/.manala/Makefile.tmpl +++ b/lazy.symfony/.manala/Makefile.tmpl @@ -74,7 +74,7 @@ sh: if [ ! -t 0 ] ; then \ $(call manala_docker_command, --no-TTY) sh -s ; \ else \ - $(manala_docker_command) bash --login ; \ + $(manala_docker_command) zsh --login ; \ fi .PHONY: sh diff --git a/lazy.symfony/.manala/docker/Dockerfile.tmpl b/lazy.symfony/.manala/docker/Dockerfile.tmpl index 1f0b9a15..94cd003e 100644 --- a/lazy.symfony/.manala/docker/Dockerfile.tmpl +++ b/lazy.symfony/.manala/docker/Dockerfile.tmpl @@ -29,7 +29,6 @@ RUN \ apt-get --quiet update \ && apt-get --quiet --yes --purge --autoremove upgrade \ && apt-get --quiet --yes --no-install-recommends --verbose-versions install \ - bash-completion \ bzip2 \ ca-certificates \ curl \ @@ -43,9 +42,10 @@ RUN \ socat \ sudo \ vim \ + zsh \ # User && addgroup --gid ${MANALA_GROUP_ID} lazy \ - && adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ + && adduser --home /home/lazy --shell /bin/zsh --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \ && install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \ && echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \ # Gosu @@ -68,10 +68,12 @@ RUN \ && curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \ --output /usr/local/bin/yq \ && chmod +x /usr/local/bin/yq \ - # Bash completion - && install --verbose --mode 0755 --directory /etc/bash_completion.d \ - # Oh My Bash - && git clone https://github.com/ohmybash/oh-my-bash.git /usr/local/share/oh-my-bash \ + # Oh My Zsh + && git clone https://github.com/ohmyzsh/ohmyzsh.git /usr/local/share/oh-my-zsh \ + # See: https://github.com/ohmyzsh/ohmyzsh/issues/11995 + && git clone https://github.com/zsh-users/zsh-autosuggestions.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-autosuggestions \ + && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /usr/local/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting \ + && echo "ZDOTDIR=/etc/zsh" > /etc/zsh/zshenv \ # Clean && rm -rf /var/lib/apt/lists/* diff --git a/lazy.symfony/.manala/etc/profile.d/oh-my-bash.sh.tmpl b/lazy.symfony/.manala/etc/profile.d/oh-my-bash.sh.tmpl deleted file mode 100644 index 847ed7c5..00000000 --- a/lazy.symfony/.manala/etc/profile.d/oh-my-bash.sh.tmpl +++ /dev/null @@ -1,157 +0,0 @@ -# Enable the subsequent settings only in interactive sessions -case $- in - *i*) ;; - *) return;; -esac - -# Path to your oh-my-bash installation. -export OSH=/usr/local/share/oh-my-bash - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-bash is loaded. -OSH_THEME="font" - -# If you set OSH_THEME to "random", you can ignore themes you don't like. -# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo") - -# Uncomment the following line to use case-sensitive completion. -# OMB_CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# OMB_HYPHEN_SENSITIVE="false" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_OSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you don't want the repository to be considered dirty -# if there are untracked files. -# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true" - -# Uncomment the following line if you want to completely ignore the presence -# of untracked files in the repository. -# SCM_GIT_IGNORE_UNTRACKED="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. One of the following values can -# be used to specify the timestamp format. -# * 'mm/dd/yyyy' # mm/dd/yyyy + time -# * 'dd.mm.yyyy' # dd.mm.yyyy + time -# * 'yyyy-mm-dd' # yyyy-mm-dd + time -# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors -# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors -# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors -# If not set, the default value is 'yyyy-mm-dd'. -# HIST_STAMPS='yyyy-mm-dd' - -# Uncomment the following line if you do not want OMB to overwrite the existing -# aliases by the default OMB aliases defined in lib/*.sh -# OMB_DEFAULT_ALIASES="check" - -# Would you like to use another custom folder than $OSH/custom? -# OSH_CUSTOM=/path/to/new-custom-folder - -# To disable the uses of "sudo" by oh-my-bash, please set "false" to -# this variable. The default behavior for the empty value is "true". -OMB_USE_SUDO=true - -# To enable/disable display of Python virtualenv and condaenv -# OMB_PROMPT_SHOW_PYTHON_VENV=true # enable -# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable - -# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) -# Custom completions may be added to ~/.oh-my-bash/custom/completions/ -# Example format: completions=(ssh git bundler gem pip pip3) -# Add wisely, as too many completions slow down shell startup. -completions=( - git - composer - {{- if .Vars.system.nodejs.version }} - npm - {{- end }} - -) - -# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*) -# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/ -# Example format: aliases=(vagrant composer git-avh) -# Add wisely, as too many aliases slow down shell startup. -aliases=( - general - ls -) - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - git - {{- if .Vars.system.nodejs.version }} - npm - {{- end }} - {{- if .Vars.deploy.inventory }} - ansible - {{- end }} -) - -# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: -# if [ "$DISPLAY" ] || [ "$SSH" ]; then -# plugins+=(tmux-autoattach) -# fi - -source "$OSH"/oh-my-bash.sh - -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-bash libs, -# plugins, and themes. Aliases can be placed here, though oh-my-bash -# users are encouraged to define aliases within the OSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias bashconfig="mate ~/.bashrc" -# alias ohmybash="mate ~/.oh-my-bash" - -# Disable full path print after cd into a directory -# See: https://github.com/ohmybash/oh-my-bash/issues/201 -unset CDPATH diff --git a/lazy.symfony/.manala/etc/profile.d/zz-direnv.sh.tmpl b/lazy.symfony/.manala/etc/profile.d/zz-direnv.sh.tmpl deleted file mode 100644 index 24ea5737..00000000 --- a/lazy.symfony/.manala/etc/profile.d/zz-direnv.sh.tmpl +++ /dev/null @@ -1,8 +0,0 @@ -eval "$(direnv hook bash)" - -# Config directory -export DIRENV_CONFIG=/etc/direnv - -# Faint output -# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv -export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m' diff --git a/lazy.symfony/.manala/etc/profile.d/message.sh.tmpl b/lazy.symfony/.manala/etc/zsh/.zlogin.tmpl similarity index 100% rename from lazy.symfony/.manala/etc/profile.d/message.sh.tmpl rename to lazy.symfony/.manala/etc/zsh/.zlogin.tmpl diff --git a/lazy.symfony/.manala/etc/zsh/.zshrc.tmpl b/lazy.symfony/.manala/etc/zsh/.zshrc.tmpl new file mode 100644 index 00000000..0b6d1cae --- /dev/null +++ b/lazy.symfony/.manala/etc/zsh/.zshrc.tmpl @@ -0,0 +1,109 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH=/usr/local/share/oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time Oh My Zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + direnv + zsh-autosuggestions + zsh-syntax-highlighting +) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# Set personal aliases, overriding those provided by Oh My Zsh libs, +# plugins, and themes. Aliases can be placed here, though Oh My Zsh +# users are encouraged to define aliases within a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/lazy.symfony/test/goss.yaml b/lazy.symfony/test/goss.yaml index a8423c44..529567b6 100644 --- a/lazy.symfony/test/goss.yaml +++ b/lazy.symfony/test/goss.yaml @@ -25,7 +25,7 @@ user: exists: true groups: - lazy - shell: /bin/bash + shell: /bin/zsh file: # Base