From 37e2dfc3a10bbb03e7a1efebaf5bc5d09a9590e6 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Wed, 28 Dec 2022 13:43:37 +0100 Subject: [PATCH] updated zsh state --- states/zsh/config.sls | 8 ++++---- states/zsh/init.sls | 4 ++-- states/zsh/install.sls | 6 ++++++ states/zsh/pkg.sls | 6 ------ states/zsh/users.sls | 5 ++--- states/zsh/{zprofile.j2 => zshenv.j2} | 2 +- states/zsh/zshrc.j2 | 3 --- 7 files changed, 15 insertions(+), 19 deletions(-) create mode 100644 states/zsh/install.sls delete mode 100644 states/zsh/pkg.sls rename states/zsh/{zprofile.j2 => zshenv.j2} (97%) delete mode 100644 states/zsh/zshrc.j2 diff --git a/states/zsh/config.sls b/states/zsh/config.sls index ee3e00b..b5be72e 100644 --- a/states/zsh/config.sls +++ b/states/zsh/config.sls @@ -15,13 +15,13 @@ zsh-autosuggestions-repo: - require: - pkg: zsh-pkg -zsh-omz-profile: +zsh-omz-env: file.managed: - - name: /etc/zsh/zprofile - - source: salt://zsh/zprofile.j2 + - name: /etc/zsh/zshenv + - source: salt://zsh/zshenv.j2 - user: root - group: root - mode: 0644 - template: jinja - require: - - pkg: zsh-pkg \ No newline at end of file + - pkg: zsh-pkg diff --git a/states/zsh/init.sls b/states/zsh/init.sls index 533e4d1..ad79720 100644 --- a/states/zsh/init.sls +++ b/states/zsh/init.sls @@ -1,6 +1,6 @@ --- include: - users - - .pkg + - .install - .config - - .users \ No newline at end of file + - .users diff --git a/states/zsh/install.sls b/states/zsh/install.sls new file mode 100644 index 0000000..3f1dc5a --- /dev/null +++ b/states/zsh/install.sls @@ -0,0 +1,6 @@ +--- +zsh-pkg: + pkg.installed: + - pkgs: + - zsh + - zsh-syntax-highlighting diff --git a/states/zsh/pkg.sls b/states/zsh/pkg.sls deleted file mode 100644 index 2b3fa81..0000000 --- a/states/zsh/pkg.sls +++ /dev/null @@ -1,6 +0,0 @@ ---- -zsh-pkg: - pkg.latest: - - pkgs: - - zsh - - zsh-syntax-highlighting \ No newline at end of file diff --git a/states/zsh/users.sls b/states/zsh/users.sls index 4c4b0b7..212d43e 100644 --- a/states/zsh/users.sls +++ b/states/zsh/users.sls @@ -5,13 +5,12 @@ zshrc-user-{{ name }}: file.managed: - name: {{ user.home }}/.zshrc - - source: salt://zsh/zshrc.j2 + - contents: "" - user: {{ name }} - group: {{ user.gid }} - mode: 0644 - - template: jinja - require: - pkg: zsh-pkg - user: user-{{ name }} {%- endif %} -{%- endfor %} \ No newline at end of file +{%- endfor %} diff --git a/states/zsh/zprofile.j2 b/states/zsh/zshenv.j2 similarity index 97% rename from states/zsh/zprofile.j2 rename to states/zsh/zshenv.j2 index 3707054..8950325 100644 --- a/states/zsh/zprofile.j2 +++ b/states/zsh/zshenv.j2 @@ -1,7 +1,7 @@ ## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }} {%- from "zsh/map.jinja" import zsh with context %} -export PATH=$PATH:/usr/local/bin:/usr/local/bin +export PATH=$PATH:/usr/local/bin:/usr/local/sbin # Main environments variables export EDITOR=nvim diff --git a/states/zsh/zshrc.j2 b/states/zsh/zshrc.j2 deleted file mode 100644 index 6611390..0000000 --- a/states/zsh/zshrc.j2 +++ /dev/null @@ -1,3 +0,0 @@ -## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }} - -source /etc/zsh/zprofile