Skip to content

Commit

Permalink
ArchLinux setup (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
kornicameister authored May 18, 2021
1 parent 4a5e56d commit 51cea63
Show file tree
Hide file tree
Showing 34 changed files with 1,879 additions and 954 deletions.
34 changes: 34 additions & 0 deletions .XResources
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
! ~/.Xresources

! colors, defaults
"color0":"#282936"
"color1":"#ea51b2"
"color2":"#00f769"
"color3":"#ebff87"
"color4":"#62d6e8"
"color5":"#b45bcf"
"color6":"#a1efe4"
"color7":"#e9e9f4"
"color8":"#4d4f68"
"color9":"#ea51b2"
"color10":"#00f769"
"color11":"#ebff87"
"color12":"#62d6e8"
"color13":"#b45bcf"
"color14":"#a1efe4"
"color15":"#f7f7fb"

! rofi
rofi.color-enabled: true
rofi.separator-style: solid
rofi.font: FONT SIZE
rofi.bw: 2
rofi.columns: 1
rofi.yoffset: 0
rofi.fake-transparency: false
rofi.hide-scrollbar: true

rofi.location: 0
rofi.width: 30
rofi.lines: 10
rofi.fixed-num-lines: true
240 changes: 240 additions & 0 deletions .circleci/verify_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
#!/bin/bash

info() {
printf "\\r [ \\033[00;34m..\\033[0m ] %s\\n" "${1}"
}

user() {
printf "\\r [ \\033[0;33m??\\033[0m ] %s\\n" "${1}"
}

success() {
printf "\\r\\033[2K [ \\033[00;32mOK\\033[0m ] %s\\n" "${1}"
}

in_progress() {
printf "\\r [ \\033[00;34m\\u23F0\\033[0m ] %s\\r" "${1}"
}

fail() {
printf "\\r\\033[2K [\\033[0;31mFAIL\\033[0m] %s\\n" "${1}" >&2
exit 666
}

exists() {
command -v "$1" &>/dev/null
}

retry() {
local n=1
local max=50
local delay=2

while true; do
if "$@"; then
break
else
if [[ $n -lt $max ]]; then
((n++))
sleep $delay
else
fail "The command has failed after $n attempts."
fi
fi
done
}

validate_bin_accessible() (
bins_to_check=(
# founations
nvim
zsh
terminator
# containers & stuff
docker
docker-compose
# git & utils
git
git-lfs
git-extras
exiftool
# gotta have python dawg
python2
python3
# node should be provided as well
node
# do not forget golang
go
# browsers
google-chrome-unstable
firefox
brave-browser-beta
# linters matter
shellcheck
yamllint
# utilities
purge-old-kernels
snap
http
tree
aria2c
ctags
htop
jq
)

for bin in "${bins_to_check[@]}"; do
if retry exists "${bin}"; then
success "${bin} is accessible via $(whereis "${bin}")"
else
fail "${bin} is not accessible"
fi
done
)

validate_interactive_bins() (
bins_to_check=(
pyenv
nodenv
goenv
jenv
fzf
)

for bin in "${bins_to_check[@]}"; do
bin_path="${HOME}/.${bin}/bin/${bin}"

if [[ -s "${bin_path}" ]]; then
v_out=$($bin_path --version | tr "'${bin}'" ' ' | sed -e 's/^[[:space:]]*//')
success "${bin} is accessible via ${bin_path} with version ${v_out}"
else
fail "${bin} is not accessible"
fi

if retry exists "${bin}"; then
success "${bin} is accessible via $(whereis "${bin}")"
else
fail "${bin} is not accessible"
fi
done
)

validate_pyenv() (
if [[ ! -s "${HOME}/.pyenv" ]]; then
fail "Failed to locate pyenv directory in \$HOME"
else
success "pyenv directory set"

local venvs_to_check
venvs_to_check=(
neovim2
neovim3
)

for venv in "${venvs_to_check[@]}"; do
if ! "${HOME}/.pyenv/bin/pyenv" versions | grep -q "${venv}"; then
fail "Virtualenv ${venv} was not installed"
else
success "Virtualenv ${venv} :: $(${HOME}/.pyenv/bin/pyenv shell ${venv} | python --version) is installed"
fi
done

zsh -mil -c "pyenv doctor"
if [[ ! -f "${HOME}/.pyenv/version" ]]; then
fail "pyenv did not set global system version"
fi
fi
)

validate_nodenv() (
if [[ ! -s "${HOME}/.nodenv" ]]; then
fail "Failed to locate nodenv directory in \$HOME"
else
success "nodenv directory set"
zsh -mil -c "npx -p @nodenv/nodenv-installer nodenv-doctor"
if [[ ! -f "${HOME}/.nodenv/version" ]]; then
fail "nodenv did not set global system version"
fi
fi

local bins_to_check
bins_to_check=(
neovim-node-host
prettier
tsc
elm-language-server
bash-language-server
vim-language-server
docker-langserver
)
for bin in "${bins_to_check[@]}"; do
bin_path="$(command -v "${bin}")"

if [[ -s "${bin_path}" ]]; then
if $bin_path --version 2>/dev/null 1>/dev/null; then
v_out=$($bin_path --version | tr -d 'Version ' | tr "'${bin}'" ' ' | sed -e 's/^[[:space:]]*//')
else
v_out="?"
fi
success "${bin} is accessible via ${bin_path} with version ${v_out}"
else
fail "${bin} is not accessible"
fi

done

)

validate_goenv() (
if [[ ! -s "${HOME}/.goenv" ]]; then
fail "Failed to locate goenv directory in \$HOME"
else
success "goenv directory set"
if [[ ! -f "${HOME}/.goenv/version" ]]; then
fail "goenv did not set global system version"
fi
fi
)

validate_jenv() (
if [[ ! -s "${HOME}/.jenv" ]]; then
fail "Failed to locate jenv directory in \$HOME"
else
success "jenv directory set"
jenv doctor
if [[ ! -f "${HOME}/.jenv/version" ]]; then
fail "jenv did not set global system version"
fi
fi
)

validate_git_config() (
if [[ ! -f "${HOME}/.gitconfig.local" ]]; then
fail "Local git configuration not set"
else
success "git configured"
fi
)

validate_wakatime_config() (
if [[ ! -f "${HOME}/.wakatime.cfg" ]]; then
fail "Local wakatime configuration not set"
else
success "wakatime configured"
fi
)

info 'Validating installation'
(
info "Path is [ $(echo "${PATH}" | tr ':' '\t\r\n') ]"
validate_git_config
validate_wakatime_config
validate_bin_accessible
validate_interactive_bins
validate_pyenv
validate_nodenv
validate_goenv
validate_jenv
)
info 'Validation successful'
screenfetch
11 changes: 0 additions & 11 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@
url = https://github.com/nodenv/nodenv.git
shallow = true
branch = master
[submodule "dependencies/ctags"]
path = dependencies/ctags
url = https://github.com/universal-ctags/ctags.git
shallow = true
ignore = untracked
branch = master
[submodule "dependencies/dotbot_plugin_aptget"]
path = dependencies/dotbot_plugin_aptget
url = https://github.com/dein0s/dotbot_plugin_aptget.git
shallow = true
branch = master
[submodule "dependencies/xxenv-latest"]
path = dependencies/xxenv-latest
url = https://github.com/momo-lab/xxenv-latest
Expand Down
15 changes: 0 additions & 15 deletions .installer/install_brave.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .installer/install_chrome.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .installer/install_ctags.sh

This file was deleted.

36 changes: 0 additions & 36 deletions .installer/install_docker.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .pam_environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
XDG_CONFIG_HOME DEFAULT=@{HOME}/.config
XDG_CACHE_HOME DEFAULT=@{HOME}/.cache
Loading

0 comments on commit 51cea63

Please sign in to comment.