Merge branch 'tweaks' into 'main'

Rust tools for brebuilt repos/releases to speed things up

See merge request sagidayan/linux-config!3
This commit is contained in:
Sagi Dayan 2022-01-04 08:26:48 +00:00
commit 1b4848caa0
9 changed files with 148 additions and 115 deletions

View file

@ -18,7 +18,7 @@ Run Workstation playbook on fedora:
Run cli-tools playbook on centos:
stage: x86 Systems
image: centos:8
image: centos:latest
script:
- dnf install -y epel-release dnf-plugins-core
- dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm

View file

@ -22,7 +22,15 @@ setw -g mouse on
bind-key | split-window -h -c "#{pane_current_path}"
bind-key \\ split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
# close window with <prefix-q>
bind-key q kill-window
# refresh window with <prefix-e>
bind-key e respawn-window -k
# <prefix>-j/k for up down (useful to move between history commands)
bind-key k send-keys Up
bind-key j send-keys Down
# Easy config reload
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
############################
@ -34,7 +42,6 @@ set -g @plugin "arcticicestudio/nord-tmux"
# set -g @plugin 'egel/tmux-gruvbox'
# set -g @tmux-gruvbox 'dark' # or 'light'
# Tmux yank (For clipboard integration)
set -g @plugin 'tmux-plugins/tmux-yank'
# Mouse select to clipboard
@ -55,3 +62,7 @@ set -g default-terminal "xterm-256color"
# Home/End support
bind -n End send-key C-e
bind -n Home send-key C-a
# Set active pane border background
set-option -g pane-active-border-style bg=#8abeb7

View file

@ -51,10 +51,12 @@ autocmd VimEnter *
" Toggle NerdTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR>
" Open fzf Files search
" Open fzf Files search Ctrl+p
map <C-p> :Files<CR>
" Open file search
" Open file search Ctrl+f
map <C-f> :BLines<CR>
" Open Global search Ctrl+s
map <C-s> :Ag<CR>
" Indent Guides auto start
let g:indent_guides_enable_on_vim_startup = 1
@ -66,10 +68,10 @@ map <C-t> :tabnew<CR>
noremap <Tab><Tab> :tabn<CR>
" Insert mode navigation Alt+hjkl
imap <C-s-h> <Left>
imap <C-s-l> <Right>
imap <C-s-j> <Down>
imap <C-s-k> <Up>
imap <M-h> <Left>
imap <M-l> <Right>
imap <M-j> <Down>
imap <M-k> <Up>
" Set line heighlight on by default
set cursorline
@ -336,6 +338,7 @@ set statusline+=\ %P "percent through file
" Note: must appear after the last line that is altering colorscheme
hi clear SpellBad
hi SpellBad cterm=underline
set spell
"==============================================================================
" Delete settings

View file

@ -9,6 +9,7 @@
- wget
- git
- ranger
- jq
state: present
- name: Some more packages (RedHat based)
@ -70,13 +71,6 @@
dest: ~/.shellconfig/common.sh
force: yes
- name: verify Bat (better Cat) theme
changed_when: false
ansible.builtin.lineinfile:
path: "~/.shellconfig/common.sh"
regexp: "^export BAT_THEME="
line: 'export BAT_THEME="${{theme}}"'
- name: Copy shell aliases
copy:
src: dotfiles/shellconfig/aliases.sh
@ -95,30 +89,7 @@
dest: ~/.shellconfig/environment.sh
force: no
- name: Verifying gitui config folder
file:
path: ~/.config/gitui
state: directory
- name: Copy gitui keybindings config file
copy:
src: dotfiles/gitui/key_config.ron
dest: ~/.config/gitui/key_config.ron
force: yes
- name: Copy gitui theme config file
copy:
src: dotfiles/gitui/theme.ron
dest: ~/.config/gitui/theme.ron
force: yes
- name: Install rust and common tooling
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [bat,lsd,bottom]
ansible.builtin.include_role:
name: hurricanehrndz.rustup
- name: Gitui user
- name: Install modern UNIX tools
include_role:
name: gitui_user
name: modern_unix_tools

View file

@ -0,0 +1,46 @@
---
- name: Validate manual versioning folder
ansible.builtin.file:
state: directory
path: ~/.ansible_gh_release_versions
- name: Setting local release file path
set_fact:
local_version_file: "~/.ansible_gh_release_versions/{{ name }}"
- name: Fetch latest release tarball url
shell:
cmd: curl -s https://api.github.com/repos/{{ repo }}/releases/latest | jq -r '.assets[] | select(.browser_download_url|test("{{ filter }}")) | .browser_download_url'
warn: false
register: tar_url
changed_when: false
- name: Get latest version tag from github
shell: echo {{ tar_url.stdout }} | grep -oP "(?<=download\/).*(?=\/)"
changed_when: false
register: version
- name: Get latest version from local entry
set_fact:
local_version: "{{ lookup('file', local_version_file, errors='ignore') }}"
version: "{{ version.stdout }}"
tar_url: "{{ tar_url.stdout }}"
tar_download_location: "/tmp/{{ name }}.tar.gz"
failed_when: false
- name: Unarchive the release
ansible.builtin.unarchive:
src: "{{ tar_url }}"
dest: /tmp/
remote_src: yes
when: version != local_version
- name: Moving bin to /usr/local/bin
become: true
shell: |
cp /tmp{{ bin_path }} /usr/local/bin/{{ name }}
when: version != local_version
- name: Updating local version entry
shell: echo {{ version }} > {{ local_version_file }}
when: version != local_version

View file

@ -1,28 +0,0 @@
- name: Install gitui dependencies (RHEL)
become: true
package:
name: &gitui_deps_rhel
- perl
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Installing gitui
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [gitui]
ansible.builtin.include_role:
name: hurricanehrndz.rustup
- name: Setting up ncspot alias (spot)
ansible.builtin.lineinfile:
line: alias spot=ncspot
state: present
path: ~/.shellconfig/aliases.sh
insertafter: EOF
- name: Remove gitui dependencies (RHEL)
become: true
package:
name: *gitui_deps_rhel
state: absent
when: ansible_facts['os_family'] == "RedHat"

View file

@ -0,0 +1,64 @@
---
- name: Installing bat (cat like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: bat
repo: sharkdp/bat
bin_path: "/bat*/bat"
filter: x86_64-unknown-linux-gnu
- name: verify Bat (better Cat) theme
changed_when: false
ansible.builtin.lineinfile:
path: "~/.shellconfig/common.sh"
regexp: "^export BAT_THEME="
line: 'export BAT_THEME="${{theme}}"'
- name: Instaling TLDR (pip3)
shell: pip3 install tldr
- name: Installing bottom (btm) (Top like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: btm
repo: ClementTsang/bottom
bin_path: "/btm"
filter: bottom_x86_64-unknown-linux-gnu.tar.gz
- name: Installing gitui
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: gitui
repo: extrawurst/gitui
bin_path: "/gitui"
filter: gitui-linux-musl
- name: Verifying gitui config
file:
path: ~/.config/gitui
state: directory
- name: Copy gitui keybindings
copy:
src: dotfiles/gitui/key_config.ron
dest: ~/.config/gitui/key_config.ron
force: yes
- name: Copy gitui theme config
copy:
src: dotfiles/gitui/theme.ron
dest: ~/.config/gitui/theme.ron
force: yes
- name: Installing LSD (ls like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: lsd
repo: Peltoche/lsd
bin_path: "/lsd-*/lsd"
filter: x86_64-unknown-linux-gnu.tar.gz

View file

@ -1,36 +1,12 @@
- name: Install ncspot dependencies (RHEL)
become: true
package:
name: &ncspot_deps_rhel
- pulseaudio-libs-devel
- libxcb-devel
- openssl-devel
- ncurses-devel
- dbus-devel
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Install ncspot dependencies (Debian)
become: true
package:
name: &ncspot_deps_debian
- libncursesw5-dev
- libdbus-1-dev
- libpulse-dev
- libssl-dev
- libxcb1-dev
- libxcb-render0-dev
- libxcb-shape0-dev
- libxcb-xfixes0-dev
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Installing nscpot
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [ncspot]
---
- name: Installing ncspot (Spotify)
ansible.builtin.include_role:
name: hurricanehrndz.rustup
name: gh_release_bin
vars:
name: ncspot
repo: hrkfdn/ncspot
bin_path: "/ncspot"
filter: linux-x86_64.tar.gz
- name: Setting up ncspot alias (spot)
ansible.builtin.lineinfile:
@ -39,16 +15,3 @@
path: ~/.shellconfig/aliases.sh
insertafter: EOF
- name: Remove ncspot dependencies (RHEL)
become: true
package:
name: *ncspot_deps_rhel
state: absent
when: ansible_facts['os_family'] == "RedHat"
- name: Remove ncspot dependencies (Debian)
become: true
package:
name: *ncspot_deps_debian
state: absent
when: ansible_facts['os_family'] == "Debian"

View file

@ -3,13 +3,16 @@
package:
name:
- vim-X11
- the_silver_searcher
state: latest
when: ansible_facts['os_family'] == "RedHat"
- name: Install vim (Debian based)
become: true
package:
name: vim-gtk
name:
- vim-gtk
- silversearcher-ag
state: present
when: ansible_facts['os_family'] == "Debian"