Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3752738
D3011.id7686.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
15 KB
Referenced Files
None
Subscribers
None
D3011.id7686.diff
View Options
diff --git a/pillar/core/users.sls b/pillar/core/users.sls
--- a/pillar/core/users.sls
+++ b/pillar/core/users.sls
@@ -125,6 +125,8 @@
- deploy_nanotab
- install_rustup
- install_diesel
+ everywhere_tasks:
+ - deploy_dotfiles
uid: 5001
dorianwinty:
diff --git a/roles/devserver/userland-home/files/dereckson/.nanorc b/roles/core/userland-home/files/dereckson/.nanorc
rename from roles/devserver/userland-home/files/dereckson/.nanorc
rename to roles/core/userland-home/files/dereckson/.nanorc
--- a/roles/devserver/userland-home/files/dereckson/.nanorc
+++ b/roles/core/userland-home/files/dereckson/.nanorc
@@ -1,4 +1,4 @@
set nowrap
set tabsize 4
-#set tabstospaces
+set tabstospaces
diff --git a/roles/core/userland-home/files/dereckson/.zkbd/screen-256color b/roles/core/userland-home/files/dereckson/.zkbd/screen-256color
new file mode 100644
--- /dev/null
+++ b/roles/core/userland-home/files/dereckson/.zkbd/screen-256color
@@ -0,0 +1,26 @@
+typeset -g -A key
+
+key[F1]='^[OP'
+key[F2]='^[OQ'
+key[F3]='^[OR'
+key[F4]='^[OS'
+key[F5]='^[[15~'
+key[F6]='^[[17~'
+key[F7]='^[[18~'
+key[F8]='^[[19~'
+key[F9]='^[[20~'
+key[F10]='^[[21~'
+key[F11]='^[[23~'
+key[F12]='^[[24~'
+key[Backspace]='^?'
+key[Insert]='^[[2~'
+key[Home]='^[[1~'
+key[PageUp]='^[[5~'
+key[Delete]='^[[3~'
+key[End]='^[[4~'
+key[PageDown]='^[[6~'
+key[Up]='^[[A'
+key[Left]='^[[D'
+key[Down]='^[[B'
+key[Right]='^[[C'
+key[Menu]=''''
diff --git a/roles/core/userland-home/files/dereckson/.zkbd/tmux-256color b/roles/core/userland-home/files/dereckson/.zkbd/tmux-256color
new file mode 120000
--- /dev/null
+++ b/roles/core/userland-home/files/dereckson/.zkbd/tmux-256color
@@ -0,0 +1 @@
+screen-256color
\ No newline at end of file
diff --git a/roles/core/userland-home/files/dereckson/.zkbd/xterm-256color b/roles/core/userland-home/files/dereckson/.zkbd/xterm-256color
new file mode 100644
--- /dev/null
+++ b/roles/core/userland-home/files/dereckson/.zkbd/xterm-256color
@@ -0,0 +1,26 @@
+typeset -g -A key
+
+key[F1]='^[OP'
+key[F2]='^[OQ'
+key[F3]='^[OR'
+key[F4]='^[OS'
+key[F5]='^[[15~'
+key[F6]='^[[17~'
+key[F7]='^[[18~'
+key[F8]='^[[19~'
+key[F9]='^[[20~'
+key[F10]='^[[21~'
+key[F11]='^[[23~'
+key[F12]='^[[24~'
+key[Backspace]='^?'
+key[Insert]='^[[2~'
+key[Home]='^[[H'
+key[PageUp]='^[[5~'
+key[Delete]='^[[3~'
+key[End]='^[[F'
+key[PageDown]='^[[6~'
+key[Up]='^[[A'
+key[Left]='^[[D'
+key[Down]='^[[B'
+key[Right]='^[[C'
+key[Menu]=''''
diff --git a/roles/devserver/userland-home/files/dereckson/.zshrc b/roles/core/userland-home/files/dereckson/.zshrc
rename from roles/devserver/userland-home/files/dereckson/.zshrc
rename to roles/core/userland-home/files/dereckson/.zshrc
--- a/roles/devserver/userland-home/files/dereckson/.zshrc
+++ b/roles/core/userland-home/files/dereckson/.zshrc
@@ -2,13 +2,22 @@
# Zsh configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Wynter
-# Created: 2017-10-26
+# Description: ZSH configuration for remote servers
# License: Trivial work, not eligible to copyright
+# Source file: roles/core/userland-home/files/dereckson/.zshrc
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
# -------------------------------------------------------------
# -------------------------------------------------------------
# Table of contents
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# -------------------------------------------------------------
#
# :: Completions
# :: History
@@ -53,6 +62,11 @@
SAVEHIST=10000
setopt appendhistory
+if [[ -a /usr/local/share/zsh/wynter/zsh-histdb/sqlite-history.zsh ]]; then
+ source /usr/local/share/zsh/wynter/zsh-histdb/sqlite-history.zsh
+ autoload -Uz add-zsh-hook
+fi
+
# -------------------------------------------------------------
# Prompt
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -93,20 +107,26 @@
# Environment
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-[[ $TERM == screen ]] && TERM=screen-256color
+[[ $TERM == xterm ]] && export TERM=xterm-256color
+[[ $TERM == screen ]] && export TERM=screen-256color
+[[ $TERM == tmux ]] && export TERM=tmux-256color
+
+export BLOCKSIZE=K
-BLOCKSIZE=K
+export EDITOR=nano
-EDITOR=nano
+export PAGER=less
+export LESS=eiMqXR
-PAGER=less
-LESS=eiMqXR
+export LC_ALL=en_US.UTF-8
# -------------------------------------------------------------
# SSH
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-source $HOME/bin/ssh-agent-session
+if [[ -a $HOME/bin/ssh-agent-session ]]; then
+ source $HOME/bin/ssh-agent-session
+fi
# -------------------------------------------------------------
# Keys bindings
@@ -117,7 +137,7 @@
bindkey -e
autoload zkbd
-source $HOME/.zkbd/screen-256color-portbld-freebsd11.0
+source $HOME/.zkbd/$TERM
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
@@ -136,26 +156,29 @@
[[ -n "$key[Left]" ]] && bindkey -- "$key[Left]" backward-char
[[ -n "$key[Right]" ]] && bindkey -- "$key[Right]" forward-char
+# Ctrl modifiers is tested but not used?
+# Probably best to take $key[Left] and $key[Right] and insert 1;5
+bindkey '^[[1;5C' emacs-forward-word
+bindkey '^[[1;5D' emacs-backward-word
+
# -------------------------------------------------------------
# External modules
#
# :: pm
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-source ~/.pm/pm.zsh
-plugins=(pm)
+if [[ -a ~/.pm/pm.zsh ]]; then
+ source ~/.pm/pm.zsh
+ plugins=(pm)
+fi
# -------------------------------------------------------------
# VCS
#
-# :: alias to git-achievements
# :: vcs_info prompt
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-alias git=git-achievements
-compdef git-achievements=git
-
setopt prompt_subst
autoload -Uz vcs_info
@@ -181,12 +204,44 @@
# https://docs.nasqueron.org/salt-wrapper/admin.html#shell-aliases
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-alias salt='salt-wrapper salt'
-alias salt-call='salt-wrapper salt-call'
-alias salt-cloud='salt-wrapper salt-cloud'
-alias salt-key='salt-wrapper salt-key'
-alias salt-run='salt-wrapper salt-run'
-alias salt-ssh='salt-wrapper salt-ssh'
+if [[ -a /usr/local/bin/salt-wrapper ]]; then
+ alias salt='salt-wrapper salt'
+ alias salt-call='salt-wrapper salt-call'
+ alias salt-cloud='salt-wrapper salt-cloud'
+ alias salt-key='salt-wrapper salt-key'
+ alias salt-run='salt-wrapper salt-run'
+ alias salt-ssh='salt-wrapper salt-ssh'
+fi
+
+# -------------------------------------------------------------
+# Go
+#
+# Switch to pm go if not installed
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if command -v go > /dev/null
+then
+ export GOPATH="$HOME/dev/go"
+elif [[ -a ~/.pm/pm.zsh ]]
+then
+ alias go='pm go'
+fi
+
+# -------------------------------------------------------------
+# External software integration
+#
+# :: starship prompt
+# :: z cd alternative
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+command -v starship > /dev/null && eval "$(starship init zsh)"
+command -v zoxide > /dev/null && eval "$(zoxide init zsh)"
+
+# -------------------------------------------------------------
+# Vault
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+export VAULT_ADDR='https://172.27.27.7:8200'
# -------------------------------------------------------------
# Misc aliases
@@ -196,15 +251,9 @@
alias cd...='cd ../..'
alias cd....='cd ../../..'
-alias go='pm go'
-
alias h=history
alias n=nano
-alias si='french-conjugator --mode=subjunctive --tense=imperfect'
-alias t='t --task-dir ~/.tasks --list tasks'
-
-alias mw='sudo -u mediawiki mw'
alias tclsh='rlwrap tclsh8.6'
alias psysh='rlwrap psysh'
diff --git a/roles/core/userland-home/init.sls b/roles/core/userland-home/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/core/userland-home/init.sls
@@ -0,0 +1,30 @@
+# -------------------------------------------------------------
+# Salt — Provision dotfiles and other personal content
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Note: Content deployed here propagate to every server,
+# for devserver only, see roles/devserver unit.
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+{% for username, user in salt['forest.get_users']().items() %}
+{% set tasks = user.get('everywhere_tasks', []) %}
+
+{% if 'deploy_dotfiles' in tasks %}
+dotfiles_to_core_{{ username }}:
+ file.recurse:
+ - name: /home/{{ username }}
+ - source: salt://roles/core/userland-home/files/{{ username }}
+ - include_empty: True
+ - clean: False
+ - user: {{ username }}
+ - group: {{ username }}
+ - template: jinja
+ - context:
+ roles: {{ salt["node.get"]("roles") }}
+ node: {{ grains["id"] }}
+{% endif %}
+
+{% endfor %}
diff --git a/roles/core/userland-software/files/tmux.conf b/roles/core/userland-software/files/tmux.conf
--- a/roles/core/userland-software/files/tmux.conf
+++ b/roles/core/userland-software/files/tmux.conf
@@ -2,8 +2,6 @@
# tmux minimal configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2018-03-08
-# Author : Sébastien Santoro aka Dereckson
# License: Trivial work, not eligible to copyright
# Source file: roles/core/userland-software/files/tmux.conf
# -------------------------------------------------------------
@@ -26,6 +24,14 @@
set -g status-right '⫻ #h — %Y-%m-%d %H:%M ⫻ ᚾ '
set -g history-limit 50000
+# -------------------------------------------------------------
+# Ensure current path is propagated
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+bind '"' split-window -c "#{pane_current_path}"
+bind % split-window -h -c "#{pane_current_path}"
+bind c new-window -c "#{pane_current_path}"
+
# -------------------------------------------------------------
# Resize shortcut keys
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -37,9 +43,11 @@
# -------------------------------------------------------------
# Mouse mode support
+#
+# :: Enable mouse mode: ^B m
+# :: Disable mouse mode: ^B M
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# Toggle mouse on with ^B m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
@@ -47,7 +55,6 @@
set -g mouse-select-window on \;\
display 'Mouse mode ON'
-# Toggle mouse off with ^B M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
diff --git a/roles/devserver/userland-home/files/dereckson/.tmux.conf b/roles/devserver/userland-home/files/dereckson/.tmux.conf
--- a/roles/devserver/userland-home/files/dereckson/.tmux.conf
+++ b/roles/devserver/userland-home/files/dereckson/.tmux.conf
@@ -1,25 +1,53 @@
+# -------------------------------------------------------------
+# tmux minimal configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/userland-software/files/tmux.conf
+# -------------------------------------------------------------
#
-# tmux minimal DcK configuration file
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# General settings
+#
+# ᚾ identifies Nasqueron servers
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-# General settings
-# ᚾ identifies Nasqueron servers
set -g prefix C-b
set -g status-right '⫻ #h — %Y-%m-%d %H:%M ⫻ ᚾ '
set -g history-limit 50000
-# Regular pane divide keys
+# -------------------------------------------------------------
+# Ensure current path is propagated
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
-# Resize shortcut keys
+# -------------------------------------------------------------
+# Resize shortcut keys
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
-# Toggle mouse on with ^B m
+# -------------------------------------------------------------
+# Mouse mode support
+#
+# :: Enable mouse mode: ^B m
+# :: Disable mouse mode: ^B M
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
@@ -27,7 +55,6 @@
set -g mouse-select-window on \;\
display 'Mouse mode ON'
-# Toggle mouse off with ^B M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
@@ -35,7 +62,10 @@
set -g mouse-select-window off \;\
display 'Mouse mode OFF'
-# Colors
+# -------------------------------------------------------------
+# Colors
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
set -g status-bg colour238
set -g status-fg colour7
diff --git a/roles/devserver/userland-home/files/dereckson/.zshrc-misc-aliases b/roles/devserver/userland-home/files/dereckson/.zshrc-misc-aliases
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-home/files/dereckson/.zshrc-misc-aliases
@@ -0,0 +1,39 @@
+# -------------------------------------------------------------
+# Zsh configuration :: misc aliases
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Wynter
+# Description: ZSH configuration for devserver
+# License: Trivial work, not eligible to copyright
+# Source file: roles/devserver/userland-home/files/dereckson/.zshrc
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Git achievements
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+if [[ -a $HOME/bin/git-achievement ]]; then
+ alias git=git-achievement
+ compdef git-achievements=git
+fi
+
+# -------------------------------------------------------------
+# Misc aliases
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+alias si='french-conjugator --mode=subjunctive --tense=imperfect'
+alias t='t --task-dir ~/.tasks --list tasks'
+
+alias mw='sudo -u mediawiki mw'
+alias tclsh='rlwrap tclsh8.6'
+alias psysh='rlwrap psysh'
+
+alias lastwolf='tail -n 50000 "$HOME/irclogs/Libera/#wolfplex.log"'
+alias lastgcu='tail -n 50000 "$HOME/irclogs/Libera/#gcu.log"'
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 20:57 (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2251204
Default Alt Text
D3011.id7686.diff (15 KB)
Attached To
Mode
D3011: Provision configuration dotfiles everywhere
Attached
Detach File
Event Timeline
Log In to Comment