Merge branch 'master' of github.com:cyplo/dotfiles

This commit is contained in:
Cyryl Płotnicki 2019-06-10 08:51:25 +01:00
commit 56789146f4
9 changed files with 61 additions and 121 deletions

View file

@ -1,16 +1,17 @@
export TERM="xterm-256color" export TERM="xterm-256color"
export GOPATH=`realpath "$HOME/go"`
export PATH="$GOPATH/bin:$PATH"
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$HOME/programs:$PATH" export PATH="$HOME/programs:$PATH"
export PATH="$HOME/tools:$PATH" export PATH="$HOME/tools:$PATH"
export PATH="$HOME/bin:$PATH" export PATH="$HOME/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export RUST_SRC_PATH=$HOME/dev/rust/src export PATH="$HOME/.local/bin:$PATH"
export GOPATH=`realpath "$HOME/go"`
export PATH="$GOPATH/bin:$PATH"
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export EDITOR="vim" export EDITOR="vim"
export KEYTIMEOUT=1 export KEYTIMEOUT=1
export VAGRANT_DEFAULT_PROVIDER=virtualbox export VAGRANT_DEFAULT_PROVIDER=virtualbox
@ -20,3 +21,4 @@ export NVM_DIR="$HOME/.nvm"
export SDKMAN_DIR="$HOME/.sdkman" export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
eval $(luarocks path --bin)

15
.vim/coc-settings.json Normal file
View file

@ -0,0 +1,15 @@
{
"languageserver": {
"golang": {
"command": "gopls",
"args": [],
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
},
"lua": {
"command": "lua-lsp",
"filetypes": ["lua"]
}
}
}

View file

@ -12,10 +12,11 @@ Plug 'cespare/vim-toml'
Plug 'Chiel92/vim-autoformat' Plug 'Chiel92/vim-autoformat'
Plug 'drmingdrmer/vim-toggle-quickfix' Plug 'drmingdrmer/vim-toggle-quickfix'
Plug 'editorconfig/editorconfig-vim' Plug 'editorconfig/editorconfig-vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'godlygeek/tabular' Plug 'godlygeek/tabular'
Plug 'https://github.com/cyplo/vim-colors-solarized.git' Plug 'https://github.com/cyplo/vim-colors-solarized.git'
Plug 'jremmen/vim-ripgrep' Plug 'jremmen/vim-ripgrep'
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': './install.sh'}
Plug 'neoclide/coc-rls'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'kien/ctrlp.vim' Plug 'kien/ctrlp.vim'
@ -23,12 +24,6 @@ Plug 'LnL7/vim-nix'
Plug 'mhinz/vim-startify' Plug 'mhinz/vim-startify'
Plug 'mileszs/ack.vim' Plug 'mileszs/ack.vim'
Plug 'plasticboy/vim-markdown' Plug 'plasticboy/vim-markdown'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'timonv/vim-cargo' Plug 'timonv/vim-cargo'

View file

@ -13,33 +13,6 @@ let g:fzf_command_prefix = 'Fzf'
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0) command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>), 1, <bang>0)
let g:ctrlp_show_hidden = 1 let g:ctrlp_show_hidden = 1
" code smarts - completion, navigation
let g:asyncomplete_remove_duplicates = 1
let g:asyncomplete_smart_completion = 1
let g:asyncomplete_auto_popup = 1
au User lsp_setup call lsp#register_server({
\ 'name': 'rls',
\ 'cmd': {server_info->['rustup', 'run', 'stable', 'rls']},
\ 'whitelist': ['rust'],
\ })
if executable('gopls')
au User lsp_setup call lsp#register_server({
\ 'name': 'gopls',
\ 'cmd': {server_info->['gopls', '-mode', 'stdio']},
\ 'whitelist': ['go'],
\ })
endif
if executable('go-langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'go-langserver',
\ 'cmd': {server_info->['go-langserver', '-gocodecompletion']},
\ 'whitelist': ['go'],
\ })
endif
let g:lsp_signs_enabled = 1 let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1 let g:lsp_diagnostics_echo_cursor = 1

1
.zshrc
View file

@ -44,3 +44,4 @@ export PATH="$PATH:$HOME/.rvm/bin"
alias tmate="tmux detach-client -E 'tmate;tmux'" alias tmate="tmux detach-client -E 'tmate;tmux'"

View file

@ -82,6 +82,7 @@ mkdir -p ~/.cargo/
echo "all links done" echo "all links done"
echo "adding GDB dashboard" echo "adding GDB dashboard"
rm -fr ~/.gdbinit*
wget -P ~ git.io/.gdbinit wget -P ~ git.io/.gdbinit
echo "adding NVM" echo "adding NVM"
@ -141,6 +142,7 @@ if [[ -z $NORUST ]]; then
(test -x "${HOME}/.cargo/bin/cargo-install-update" || cargo install cargo-update) (test -x "${HOME}/.cargo/bin/cargo-install-update" || cargo install cargo-update)
(test -x "${HOME}/.cargo/bin/rg" || cargo install ripgrep) (test -x "${HOME}/.cargo/bin/rg" || cargo install ripgrep)
(test -x "${HOME}/.cargo/bin/fd" || cargo install fd-find) (test -x "${HOME}/.cargo/bin/fd" || cargo install fd-find)
(test -x "${HOME}/.cargo/bin/bat" || cargo install bat)
(test -x "${HOME}/.cargo/bin/genpass" || cargo install genpass) (test -x "${HOME}/.cargo/bin/genpass" || cargo install genpass)
set +e set +e
@ -186,6 +188,21 @@ if [[ -z $NORUBY ]]; then
rvm install ruby --disable-binary rvm install ruby --disable-binary
fi fi
# go
if [[ -z $NO_GO ]]; then
GOPATH="$HOME/go"
export GOPATH=`realpath "$GOPATH"`
mkdir -p "$GOPATH"
# excercism
go get -u -t github.com/exercism/cli/exercism
go get -u -t golang.org/x/tools/cmd/gopls
fi
# lua
luarocks install --local --server=http://luarocks.org/dev lua-lsp
luarocks install --local luacheck
if [[ -z $NOVIM ]]; then if [[ -z $NOVIM ]]; then
if [[ ! -d ~/.fzf ]]; then if [[ ! -d ~/.fzf ]]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
@ -199,57 +216,18 @@ if [[ -z $NOVIM ]]; then
~/.fzf/install --64 --all ~/.fzf/install --64 --all
fi fi
echo "Installing Vim plugins" echo "Installing Vim plugins"
echo "\n" | vim +PlugUpgrade +qa
echo "\n" | vim +PlugUpdate +qa
echo "\n" | vim +PlugClean! +qa echo "\n" | vim +PlugClean! +qa
echo "\n" | vim +PlugInstall! +qa
fi
if [[ -z $NO_GO ]]; then
GOPATH="$HOME/go"
export GOPATH=`realpath "$GOPATH"`
mkdir -p "$GOPATH"
# excercism
go get -u github.com/exercism/cli/exercism
fi fi
nvm use node nvm use node
npm install -g reveal-md npx npm install -g yarn
npm install -g diff-so-fancy npx npm install -g reveal-md
npm install -g cssnano npx npm install -g diff-so-fancy
npx npm install -g cssnano
if [[ -z $NOPYTHON3 ]]; then
set +e
pip3_path=`which pip3`
set -e
echo "pip3 path is $pip3_path"
if [[ -x "$pip3_path" ]]; then
echo "Choosing pip3 for pip"
PIP=pip3
else
echo "Choosing pip"
PIP=pip
fi
echo "Upgrading pip"
set +e
$SUDO $PIP install --upgrade pip setuptools
$SUDO $PIP install --upgrade packaging
set -e
echo "Installing Nikola"
$SUDO $PIP install --upgrade pygments-style-solarized ws4py watchdog webassets Nikola aiohttp
echo "Installing vim dependencies"
$SUDO $PIP install neovim
fi
if [[ -z $USER ]]; then
USER=`whoami`
fi
# normalize npm permissions
mkdir -p $HOME/.npm
$SUDO chown -R $USER $HOME/.npm
echo echo
echo "now go ahead and restart" echo "now go ahead and restart"
echo echo

View file

@ -18,39 +18,6 @@ RUN dnf -y groupinstall gnome
# requirements for early packages and crates # requirements for early packages and crates
RUN dnf -y --best --allowerasing install openssl-devel ncurses-devel RUN dnf -y --best --allowerasing install openssl-devel ncurses-devel
# rust
RUN curl -sSf https://sh.rustup.rs > /tmp/blastoff.sh
RUN chmod a+x /tmp/blastoff.sh
RUN /tmp/blastoff.sh -y
RUN rm -f /tmp/blastoff.sh
RUN /root/.cargo/bin/rustup update
RUN /root/.cargo/bin/rustup install stable
RUN /root/.cargo/bin/rustup install nightly
RUN /root/.cargo/bin/rustup default stable
RUN /root/.cargo/bin/rustup component add rls --toolchain stable
RUN /root/.cargo/bin/rustup component add clippy --toolchain stable
RUN /root/.cargo/bin/rustup component add rustfmt --toolchain stable
RUN /root/.cargo/bin/rustup component add rust-analysis --toolchain stable
RUN /root/.cargo/bin/rustup component add rust-src --toolchain stable
RUN /root/.cargo/bin/cargo install cargo-update rustsym ripgrep fd-find genpass
RUN /root/.cargo/bin/cargo install-update -a
# vim
RUN mkdir -p /root/dev/
RUN git clone https://github.com/vim/vim.git --recursive /root/dev/vim
RUN cd /root/dev/vim && ./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp \
--enable-python3interp=yes \
--enable-luainterp \
--enable-gui=no \
--enable-cscope
RUN cd /root/dev/vim && make -j`nproc`
RUN cd /root/dev/vim && make install
# basic packages # basic packages
RUN dnf -y --best --allowerasing install tmux atop zsh aria2 lm_sensors python3-pip whois curl pv terminator gsmartcontrol python-pip mercurial cmake glances dkms git xz util-linux-user dnf-automatic yum-utils util-linux-user archivemount redhat-rpm-config grub2 grub2-efi dracut dracut-tools fail2ban syncthing wget wireguard-dkms wireguard-tools parted lsscsi ksh dnf-plugins-core restic duply RUN dnf -y --best --allowerasing install tmux atop zsh aria2 lm_sensors python3-pip whois curl pv terminator gsmartcontrol python-pip mercurial cmake glances dkms git xz util-linux-user dnf-automatic yum-utils util-linux-user archivemount redhat-rpm-config grub2 grub2-efi dracut dracut-tools fail2ban syncthing wget wireguard-dkms wireguard-tools parted lsscsi ksh dnf-plugins-core restic duply

View file

@ -16,7 +16,10 @@ if [[ -z $NOUPGRADE ]]; then
sudo dnf -y upgrade --best --allowerasing sudo dnf -y upgrade --best --allowerasing
fi fi
sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel whois curl pv gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel cmake gtk2-devel intltool gparted glances dkms kernel-devel gimp git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget wireguard-dkms wireguard-tools lldb python-lldb kdbg zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel parted lsscsi ksh openssl-devel elfutils-libelf-devel libtirpc-devel kernel-devel ffmpeg-libs dnf-plugins-core restic duply docker steam clang llvm-devel clang-devel libsodium-devel chromium vim sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel whois curl pv gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel cmake gtk2-devel intltool gparted glances dkms kernel-devel gimp git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget wireguard-dkms wireguard-tools lldb python-lldb kdbg zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel parted lsscsi ksh openssl-devel elfutils-libelf-devel libtirpc-devel kernel-devel ffmpeg-libs dnf-plugins-core restic duply docker steam clang llvm-devel clang-devel libsodium-devel chromium vim tlp tlp-rdw lua lua-devel luarocks snapd
# enable snap classic
sudo ln -s /var/lib/snapd/snap /snap
sudo cp -v /etc/dnf/automatic.conf /etc/dnf/automatic.conf.bak sudo cp -v /etc/dnf/automatic.conf /etc/dnf/automatic.conf.bak
sudo cp -v $DIR/etc/dnf/automatic.conf /etc/dnf/automatic.conf sudo cp -v $DIR/etc/dnf/automatic.conf /etc/dnf/automatic.conf
@ -66,6 +69,11 @@ if [[ -z $NO_SYSTEMCTL ]]; then
sudo systemctl restart dnf-automatic-install.timer sudo systemctl restart dnf-automatic-install.timer
sudo systemctl enable fstrim.timer sudo systemctl enable fstrim.timer
sudo systemctl restart fstrim.timer sudo systemctl restart fstrim.timer
sudo systemctl enable tlp
sudo systemctl restart tlp
sudo systemctl enable tlp-sleep
sudo systemctl restart tlp-sleep
sudo systemctl mask systemd-rfkill.socket
sudo systemctl enable --now syncthing@cyryl.service sudo systemctl enable --now syncthing@cyryl.service
systemctl --user daemon-reload systemctl --user daemon-reload
systemctl --user enable restic-backup.timer systemctl --user enable restic-backup.timer

View file

@ -5,7 +5,7 @@ set -v
sudo apt update sudo apt update
sudo apt -y upgrade sudo apt -y upgrade
sudo apt -y --fix-missing install apt-file aptitude aria2 atop cmake curl git glances gnupg2 keepass2 mercurial pv python-dev python-pip python3-pip ruby-dev tmux vim whois zsh dirmngr syncthing net-tools coreutils xclip wget scdaemon flatpak gnome-software-plugin-flatpak sudo apt -y --fix-missing install apt-file aptitude aria2 atop cmake curl git glances gnupg2 keepass2 mercurial pv python-dev python-pip python3-pip ruby-dev tmux vim whois zsh dirmngr syncthing net-tools coreutils xclip wget scdaemon flatpak gnome-software-plugin-flatpak ufw
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
@ -18,6 +18,7 @@ if [[ -z $USER ]]; then
USER=`whoami` USER=`whoami`
fi fi
sudo groupadd docker | true
sudo usermod -aG docker $USER sudo usermod -aG docker $USER
if [[ -z $NO_SYSTEMCTL ]]; then if [[ -z $NO_SYSTEMCTL ]]; then