updated zsh state

This commit is contained in:
Paul 2021-09-25 16:03:39 +02:00
parent 18300a1b1d
commit 97fb5734d5
5 changed files with 26 additions and 15 deletions

View File

@ -1,4 +1,8 @@
---
zsh:
enabled: true
config: {}
config:
minimal: false
golang: true
rust: true
android: false

6
states/zsh/map.jinja Normal file
View File

@ -0,0 +1,6 @@
{%- import_yaml "zsh/defaults.yaml" as default_settings -%}
{%- set defaults = salt['grains.filter_by'](default_settings, default='zsh') -%}
{%- set zsh = salt['pillar.get']('zsh', default=defaults, merge=True) -%}
{%- set users = salt['pillar.get']('users', default=defaults, merge=True) -%}

View File

@ -1,5 +1,5 @@
---
{%- from "users/map.jinja" import users with context -%}
{%- from "zsh/map.jinja" import users with context %}
{%- for user in users %}
{%- if user.enabled %}
zshrc-user-{{ user.name }}:

View File

@ -1,10 +1,11 @@
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "zsh/map.jinja" import zsh with context %}
# Main environments variables
export EDITOR=vim
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
{% if zsh.config.golang -%}
# Golang settings
if [[ -d /usr/local/apps/go ]]
then
@ -12,44 +13,44 @@ then
export GOROOT=/usr/local/apps/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
fi
{%- endif %}
{% if zsh.config.rust -%}
# Rust settings
if [[ -d ~/.cargo/bin ]]
then
export PATH=$PATH:$HOME/.cargo/bin
fi
{%- endif %}
{% if zsh.config.android -%}
# Android settings
if [[ -d ~/Android ]]
then
export ANDROID_SDK_ROOT=~/Android
fi
{%- endif %}
# Oh my ZSH settings
export ZSH=/usr/share/oh-my-zsh
ZSH_THEME="jreese"
DISABLE_AUTO_UPDATE="true"
{%- if zsh.config.minimal %}
plugins=(common-aliases docker)
{%- else %}
plugins=(common-aliases sudo docker salt git ansible command-not-found systemd python nmap zsh-autosuggestions)
{%- endif %}
{#
#for example
#plugins=(common-aliases sudo docker salt git ansible command-not-found virtualenvwrapper tmux systemd python golang nmap)
#}
if [[ -f $ZSH/oh-my-zsh.sh ]]
then
source $ZSH/oh-my-zsh.sh
fi
# Acme settings
if [[ -f /root/.acme.sh/acme.sh.env ]]
then
. /root/.acme.sh/acme.sh.env
fi
# Misc settings
bindkey -e
unsetopt share_history