Modulize the environment
This commit is contained in:
parent
0b48fe1a3c
commit
6349fa1e51
8 changed files with 70 additions and 53 deletions
3
.bin/.e
3
.bin/.e
|
@ -9,7 +9,8 @@ declare -A mapper=(
|
|||
["bash"]="$HOME/.bashrc"
|
||||
["bspwm"]="$HOME/.config/bspwm/bspwmrc"
|
||||
["environment"]="$HOME/.config/environment"
|
||||
["environment.local"]="$HOME/.config/environment.local"
|
||||
["environment.d"]="$HOME/.config/environment.d/"
|
||||
["environment.local"]="$HOME/.config/environment.d/99-local"
|
||||
["git"]="$HOME/.config/git/config"
|
||||
["git-ignore"]="$HOME/.config/git/ignore"
|
||||
["home-manager"]="$HOME/.config/home-manager/home.nix"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# shellcheck disable=2155
|
||||
|
||||
set -a
|
||||
#. "/etc/profile"
|
||||
|
@ -6,9 +7,6 @@ set -a
|
|||
. "$XDG_CONFIG_HOME/locale.conf"
|
||||
set +a
|
||||
|
||||
export ANDROID_SDK_ROOT='/opt/android-sdk'
|
||||
export ANSIBLE_VAULT_PASSWORD_FILE="$HOME/.bin/ansible-vault-pass.sh"
|
||||
export ANSIBLE_PYTHON_INTERPRETER='auto_silent'
|
||||
export AUTOSTART_DISPLAY=''
|
||||
|
||||
export BEMENU_OPTS="--tb '#6272a4'\
|
||||
|
@ -27,39 +25,15 @@ export BEMENU_OPTS="--tb '#6272a4'\
|
|||
|
||||
export DMENU="bemenu"
|
||||
export DOCKER_BUILDKIT=1
|
||||
export DRONE_SERVER='https://ci.serguzim.me'
|
||||
|
||||
_editor="$(which vim)"
|
||||
[ -x "$(command -v nvim)" ] && _editor="$(which nvim)"
|
||||
export EDITOR="$_editor"
|
||||
export EDITOR="$(which vim)"
|
||||
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
export HOSTNAME="$(cat /proc/sys/kernel/hostname)"
|
||||
|
||||
_hostname=$(cat /proc/sys/kernel/hostname)
|
||||
export HOSTNAME="$_hostname"
|
||||
|
||||
export KUBECONFIG="$HOME/.kube/config"
|
||||
|
||||
#export LOCALE_ARCHIVE="/usr/lib/locale/locale-archive"
|
||||
|
||||
export MAILCAPS="$XDG_CONFIG_HOME/mailcap/mailcaprc"
|
||||
_makeflags=$(grep -c ^processor /proc/cpuinfo)
|
||||
export MAKEFLAGS="-j$_makeflags"
|
||||
export MARKPATH="$XDG_CONFIG_HOME/zsh/jump_marks"
|
||||
export MAKEFLAGS="-j$(grep -c ^processor /proc/cpuinfo)"
|
||||
export MOAR="--style=dracula"
|
||||
|
||||
_whoami=$(whoami)
|
||||
export NIX_PATH="$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/$_whoami/channels${NIX_PATH:+:$NIX_PATH}"
|
||||
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config"
|
||||
|
||||
export OPENFAAS_URL="https://faas.serguzim.me"
|
||||
export OSH="$XDG_CONFIG_HOME/bash/oh-my-bash"
|
||||
|
||||
export PASSWORD_STORE_GENERATED_LENGTH='64'
|
||||
# add my paths
|
||||
export PATH="$HOME/.local/bin:$HOME/.bin:$PATH"
|
||||
# add tool paths
|
||||
export PATH="$GOPATH/bin:$HOME/.cargo/bin:$HOME/.local/share/JetBrains/Toolbox/scripts:$PATH"
|
||||
export PS1='\$ '
|
||||
|
||||
#export QT_QPA_PLATFORM="wayland;xcb"
|
||||
|
@ -73,25 +47,9 @@ export TIME_STYLE="long-iso"
|
|||
|
||||
export VIMINIT="if has('nvim') | source $XDG_CONFIG_HOME/nvim/init.lua | else | source $XDG_CONFIG_HOME/vim/vimrc | endif"
|
||||
|
||||
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
|
||||
export WOODPECKER_SERVER="https://ci.serguzim.me"
|
||||
|
||||
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
||||
export ZSH="$ZDOTDIR/oh-my-zsh"
|
||||
|
||||
### conditionals
|
||||
|
||||
# shellcheck disable=2089
|
||||
[ -x "$(command -v bat)" ] && export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
# shellcheck disable=2090
|
||||
[ -x "$(command -v moar)" ] && export MANPAGER="moar"
|
||||
[ -x "$(command -v moar)" ] && export PAGER="moar"
|
||||
|
||||
[ -x "$(command -v gpgconf)" ] && export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
|
||||
[ -x "$(command -v home-manager)" ] \
|
||||
&& [ -x "$(command -v nix)" ] \
|
||||
&& [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ] \
|
||||
&& . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
[ -f "$HOME/.config/environment.local" ] && . "$HOME/.config/environment.local"
|
||||
for profile in "$HOME/.config/environment.d/"*; do
|
||||
# shellcheck disable=1090
|
||||
test -r "$profile" && . "$profile"
|
||||
done
|
||||
unset profile
|
||||
|
|
2
.config/environment.d/.gitignore
vendored
Normal file
2
.config/environment.d/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
10-home-manager.conf
|
||||
99-local
|
14
.config/environment.d/10-paths
Normal file
14
.config/environment.d/10-paths
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
|
||||
export NIX_PATH="$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/$(whoami)/channels${NIX_PATH:+:$NIX_PATH}"
|
||||
|
||||
# add my paths
|
||||
export PATH="$HOME/.local/bin:$HOME/.bin:$PATH"
|
||||
# add lang paths
|
||||
export PATH="$GOPATH/bin:$HOME/.cargo/bin:$PATH"
|
||||
# add tool paths
|
||||
export PATH="$HOME/.local/share/JetBrains/Toolbox/scripts:$PATH"
|
||||
|
||||
|
2
.config/environment.d/20-ansible
Normal file
2
.config/environment.d/20-ansible
Normal file
|
@ -0,0 +1,2 @@
|
|||
export ANSIBLE_VAULT_PASSWORD_FILE="$HOME/.bin/ansible-vault-pass.sh"
|
||||
export ANSIBLE_PYTHON_INTERPRETER='auto_silent'
|
17
.config/environment.d/20-files
Normal file
17
.config/environment.d/20-files
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export KUBECONFIG="$HOME/.kube/config"
|
||||
|
||||
export MAILCAPS="$XDG_CONFIG_HOME/mailcap/mailcaprc"
|
||||
export MARKPATH="$XDG_CONFIG_HOME/zsh/jump_marks"
|
||||
|
||||
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config"
|
||||
|
||||
export OSH="$XDG_CONFIG_HOME/bash/oh-my-bash"
|
||||
|
||||
export SQLITE_HISTORY="$HOME/.local/cache/sqlite_history"
|
||||
|
||||
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
|
||||
|
||||
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
||||
export ZSH="$ZDOTDIR/oh-my-zsh"
|
7
.config/environment.d/30-services
Normal file
7
.config/environment.d/30-services
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export DRONE_SERVER='https://ci.serguzim.me'
|
||||
|
||||
export OPENFAAS_URL="https://faas.serguzim.me"
|
||||
|
||||
export WOODPECKER_SERVER="https://ci.serguzim.me"
|
16
.config/environment.d/90-conditionals
Normal file
16
.config/environment.d/90-conditionals
Normal file
|
@ -0,0 +1,16 @@
|
|||
#/usr/bin/env sh
|
||||
|
||||
# shellcheck disable=2089
|
||||
[ -x "$(command -v bat)" ] && export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
# shellcheck disable=2090
|
||||
[ -x "$(command -v moar)" ] && export MANPAGER="moar"
|
||||
[ -x "$(command -v moar)" ] && export PAGER="moar"
|
||||
|
||||
[ -x "$(command -v nvim)" ] && export EDITOR="$(which nvim)"
|
||||
|
||||
[ -x "$(command -v gpgconf)" ] && export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
||||
|
||||
[ -x "$(command -v home-manager)" ] \
|
||||
&& [ -x "$(command -v nix)" ] \
|
||||
&& [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ] \
|
||||
&& . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
Loading…
Reference in a new issue