commit 6876d843402bf7a197d1cb7897498cf6780db901 Author: Sagi Dayan Date: Fri Oct 22 14:45:20 2021 +0300 Initial commit diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b2eab53 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,35 @@ +--- +stages: +- dnf_systems +- apt_systems + +Run Workstation playbook on fedora: + stage: dnf_systems + image: fedora + script: + - dnf install -y ansible python3-pip + - pip3 install -r ci-requirements.txt + - mkdir /tmp/artifacts + - ANSIBLE_CONFIG=$(pwd)/ansible.cfg JUNIT_OUTPUT_DIR=/tmp/artifacts ansible-playbook workstation.yml || (mv /tmp/artifacts/workstation-*.xml report.xml && exit 1) + - cp /tmp/artifacts/workstation-*.xml report.xml + - ls /tmp/artifacts + artifacts: + when: always + reports: + junit: report.xml + +Run Workstation playbook on ubuntu: + stage: apt_systems + image: ubuntu + script: + - apt-get update + - apt-get install -y ansible python3-pip python3-apt + - pip3 install -r ci-requirements.txt + - mkdir /tmp/artifacts + - ANSIBLE_CONFIG=$(pwd)/ansible.cfg JUNIT_OUTPUT_DIR=/tmp/artifacts ansible-playbook workstation.yml || (mv /tmp/artifacts/workstation-*.xml report.xml && exit 1) + - mv /tmp/artifacts/workstation-*.xml report.xml + - ls /tmp/artifacts + artifacts: + when: always + reports: + junit: report.xml diff --git a/README.md b/README.md new file mode 100644 index 0000000..2777a90 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +[![CI Pipeline State](https://gitlab.com/sagidayan/linux-config/badges/main/pipeline.svg)](https://gitlab.com/sagidayan/linux-config/-/commits/main) +# Configurations and Applications +## Using ansible playbooks + + +⚠️ WIP + + +### Workstation config + +``` +ansible-playbook workstation.yml +``` diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..a4591d8 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] + +output_dir = /tmp/artifacts +transport = local +callback_whitelist = junit diff --git a/ci-requirements.txt b/ci-requirements.txt new file mode 100644 index 0000000..e23fec1 --- /dev/null +++ b/ci-requirements.txt @@ -0,0 +1 @@ +junit_xml diff --git a/files/dotfiles/alacritty.yml b/files/dotfiles/alacritty.yml new file mode 100644 index 0000000..d1df20d --- /dev/null +++ b/files/dotfiles/alacritty.yml @@ -0,0 +1,277 @@ +--- +window: + # Blank space added around the window in pixels + padding: + x: 2 + y: 2 + + # Spread additional padding evenly around the terminal content + dynamic_padding: true + + # Disable border and title bar + decorations: none + +font: + normal: + family: Hack Nerd Font + style: Regular + bold: + family: Hack Nerd Font + style: Bold + italic: + family: Hack Nerd Font + style: Italic + # Point size of the font + size: 11 + +mouse: + hide_when_typing: true + +selection: + # When set to `true`, selected text will be copied to the primary + # clipboard. + save_to_clipboard: true + +cursor: + style: + blinking: Always + # Thickness of the cursor (number from `0.0` to `1.0`) + thickness: 0.18 + # Vi mode cursor style + vi_mode_style: Block + # Blink Interval + blink_interval: 400 + + ########################################################### + # Themes # + ########################################################### +schemes: +# For themes -> https://github.com/aarowill/base16-alacritty + # Base16 Monokai 256 - alacritty color config + # Wimer Hazenberg (http://www.monokai.nl) + monokai: &monokai + # Default colors + primary: + background: '0x2d2a2e' + foreground: '0xf8f8f2' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x272822' + cursor: '0xf8f8f2' + + # Normal colors + normal: + black: '0x272822' + red: '0xf92672' + green: '0xa6e22e' + yellow: '0xf4bf75' + blue: '0x66d9ef' + magenta: '0xae81ff' + cyan: '0xa1efe4' + white: '0xf8f8f2' + + # Bright colors + bright: + black: '0x75715e' + red: '0xf92672' + green: '0xa6e22e' + yellow: '0xf4bf75' + blue: '0x66d9ef' + magenta: '0xae81ff' + cyan: '0xa1efe4' + white: '0xf9f8f5' + + indexed_colors: + - { index: 16, color: '0xfd971f' } + - { index: 17, color: '0xcc6633' } + - { index: 18, color: '0x383830' } + - { index: 19, color: '0x49483e' } + - { index: 20, color: '0xa59f85' } + - { index: 21, color: '0xf5f4f1' } + # Base16 Gruvbox dark, medium 256 - alacritty color config + # Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + gruvbox: &gruvbox + # Default colors + primary: + background: '0x282828' + foreground: '0xd5c4a1' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x282828' + cursor: '0xd5c4a1' + + # Normal colors + normal: + black: '0x282828' + red: '0xfb4934' + green: '0xb8bb26' + yellow: '0xfabd2f' + blue: '0x83a598' + magenta: '0xd3869b' + cyan: '0x8ec07c' + white: '0xd5c4a1' + + # Bright colors + bright: + black: '0x665c54' + red: '0xfb4934' + green: '0xb8bb26' + yellow: '0xfabd2f' + blue: '0x83a598' + magenta: '0xd3869b' + cyan: '0x8ec07c' + white: '0xfbf1c7' + + indexed_colors: + - { index: 16, color: '0xfe8019' } + - { index: 17, color: '0xd65d0e' } + - { index: 18, color: '0x3c3836' } + - { index: 19, color: '0x504945' } + - { index: 20, color: '0xbdae93' } + - { index: 21, color: '0xebdbb2' } + # Base16 Dracula 256 - alacritty color config + # Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula) + dracula: &drakula + # Default colors + primary: + background: '0x282936' + foreground: '0xe9e9f4' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x282936' + cursor: '0xe9e9f4' + + # Normal colors + normal: + black: '0x282936' + red: '0xea51b2' + green: '0xebff87' + yellow: '0x00f769' + blue: '0x62d6e8' + magenta: '0xb45bcf' + cyan: '0xa1efe4' + white: '0xe9e9f4' + + # Bright colors + bright: + black: '0x626483' + red: '0xea51b2' + green: '0xebff87' + yellow: '0x00f769' + blue: '0x62d6e8' + magenta: '0xb45bcf' + cyan: '0xa1efe4' + white: '0xf7f7fb' + + indexed_colors: + - { index: 16, color: '0xb45bcf' } + - { index: 17, color: '0x00f769' } + - { index: 18, color: '0x3a3c4e' } + - { index: 19, color: '0x4d4f68' } + - { index: 20, color: '0x62d6e8' } + - { index: 21, color: '0xf1f2f8' } + # Base16 OneDark 256 - alacritty color config + # Lalit Magant (http://github.com/tilal6991) + onedark: &onedark + # Default colors + primary: + background: '0x282c34' + foreground: '0xabb2bf' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x282c34' + cursor: '0xabb2bf' + + # Normal colors + normal: + black: '0x282c34' + red: '0xe06c75' + green: '0x98c379' + yellow: '0xe5c07b' + blue: '0x61afef' + magenta: '0xc678dd' + cyan: '0x56b6c2' + white: '0xabb2bf' + + # Bright colors + bright: + black: '0x545862' + red: '0xe06c75' + green: '0x98c379' + yellow: '0xe5c07b' + blue: '0x61afef' + magenta: '0xc678dd' + cyan: '0x56b6c2' + white: '0xc8ccd4' + + indexed_colors: + - { index: 16, color: '0xd19a66' } + - { index: 17, color: '0xbe5046' } + - { index: 18, color: '0x353b45' } + - { index: 19, color: '0x3e4451' } + - { index: 20, color: '0x565c64' } + - { index: 21, color: '0xb6bdca' } + # Copyright (c) 2017-present Arctic Ice Studio + # Copyright (c) 2017-present Sven Greb + + # Project: Nord Alacritty + # Version: 0.1.0 + # Repository: https://github.com/arcticicestudio/nord-alacritty + # License: MIT + # References: + # https://github.com/alacritty/alacritty + + nord: &nord + primary: + background: '#2e3440' + foreground: '#d8dee9' + dim_foreground: '#a5abb6' + cursor: + text: '#2e3440' + cursor: '#d8dee9' + vi_mode_cursor: + text: '#2e3440' + cursor: '#d8dee9' + selection: + text: CellForeground + background: '#4c566a' + search: + matches: + foreground: CellBackground + background: '#88c0d0' + bar: + background: '#434c5e' + foreground: '#d8dee9' + normal: + black: '#3b4252' + red: '#bf616a' + green: '#a3be8c' + yellow: '#ebcb8b' + blue: '#81a1c1' + magenta: '#b48ead' + cyan: '#88c0d0' + white: '#e5e9f0' + bright: + black: '#4c566a' + red: '#bf616a' + green: '#a3be8c' + yellow: '#ebcb8b' + blue: '#81a1c1' + magenta: '#b48ead' + cyan: '#8fbcbb' + white: '#eceff4' + dim: + black: '#373e4d' + red: '#94545d' + green: '#809575' + yellow: '#b29e75' + blue: '#68809a' + magenta: '#8c738c' + cyan: '#6d96a5' + white: '#aeb3bb' + +colors: *nord diff --git a/files/dotfiles/gitconfig b/files/dotfiles/gitconfig new file mode 100644 index 0000000..917074e --- /dev/null +++ b/files/dotfiles/gitconfig @@ -0,0 +1,45 @@ +[user] + name = Sagi Dayan + email = sagidayan@gmail.com + +[color] + # Use colors in Git commands that are capable of colored output when + # outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.) + ui = auto +[color "branch"] + current = yellow reverse + local = yellow + remote = green +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold +[color "status"] + added = yellow + changed = green + untracked = cyan + +[format] + pretty = "Commit: %C(yellow)%H%nAuthor: %C(green)%aN <%aE>%nDate: (%C(red)%ar%Creset) %ai%nSubject: %s%n%n%b" +[core] + editor = flatpak run --file-forwarding re.sonny.Commit @@ +[alias] + st = status -vs + lol = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit + ada = add . + cm = commit -m + ck = checkout + +[diff] + tool = vimdiff + +[difftool "meld_flatpak"] + cmd = flatpak run \"--filesystem=$(realpath \"$LOCAL\")\" \"--filesystem=$(realpath \"$REMOTE\")\" org.gnome.meld \"$LOCAL\" \"$REMOTE\" +[difftool] + prompt = false + +[format] + pretty = "Commit: %C(yellow)%H%nAuthor: %C(green)%aN <%aE>%nDate: (%C(red)%ar%Creset) %ai%nSubject: %s%n%n%b" +[commit] + gpgsign = true diff --git a/files/dotfiles/shellconfig/aliases.sh b/files/dotfiles/shellconfig/aliases.sh new file mode 100644 index 0000000..08dae15 --- /dev/null +++ b/files/dotfiles/shellconfig/aliases.sh @@ -0,0 +1,5 @@ +#!/bin/bash +############################################ +# Shell aliases +############################################ + diff --git a/files/dotfiles/shellconfig/common.sh b/files/dotfiles/shellconfig/common.sh new file mode 100644 index 0000000..75571c7 --- /dev/null +++ b/files/dotfiles/shellconfig/common.sh @@ -0,0 +1,40 @@ +#!/bin/bash +######################################################## +# DO NOT EDIT - WILL BE DISCARDED IN NEXT PLAYBOOK RUN # +######################################################## + + +############################################ +# Shell aliases +############################################ +alias spot=ncspot +alias :q=exit + +alias ls='lsd' +alias f='printf "\033c"' +alias cat=bat + + + +############################################ +# Environment Variables +############################################ + +# bat theme (New cat) $ bat --list-themes +gruvbox="gruvbox" +monokai="Monokai Extended" +nord="Nord" + +export BAT_THEME="$nord" + + +export VISUAL=vim; +export EDITOR=vim; + + + +############################################ +# Shell functions +############################################ + + diff --git a/files/dotfiles/shellconfig/environment.sh b/files/dotfiles/shellconfig/environment.sh new file mode 100644 index 0000000..247247a --- /dev/null +++ b/files/dotfiles/shellconfig/environment.sh @@ -0,0 +1,5 @@ +#!/bin/bash +############################################ +# Environment Variables +############################################ + diff --git a/files/dotfiles/shellconfig/functions.sh b/files/dotfiles/shellconfig/functions.sh new file mode 100644 index 0000000..1d0b303 --- /dev/null +++ b/files/dotfiles/shellconfig/functions.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +############################################ +# Shell functions +############################################ + diff --git a/files/dotfiles/tmux.conf b/files/dotfiles/tmux.conf new file mode 100644 index 0000000..02a75c9 --- /dev/null +++ b/files/dotfiles/tmux.conf @@ -0,0 +1,51 @@ +# Send prefix +set-option -g prefix C-a +unbind-key C-a +bind-key C-a send-prefix + +# Use Alt-arrow keys to switch panes +bind-key h select-pane -L +bind-key l select-pane -R +bind-key k select-pane -U +bind-key j select-pane -D + +# Shift arrow to switch windows +bind -n M-h previous-window +bind -n M-l next-window + +# Mouse mode +setw -g mouse on + +# Set easier window split keys +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}" + +# Easy config reload +bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." +############################ +# Themes +########################### +# Nord theme +set -g @plugin "arcticicestudio/nord-tmux" +# Gruvbox Theme +# 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 +set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' + +# Buffer line size (History) +set -g history-limit 5000 + +# Use Ctrl-K to clear buffer +bind -n C-k clear-history + +# Default Colors +set -g default-terminal "xterm-256color" diff --git a/files/dotfiles/vimrc b/files/dotfiles/vimrc new file mode 100644 index 0000000..075f12f --- /dev/null +++ b/files/dotfiles/vimrc @@ -0,0 +1,345 @@ +"============================================================================== +" vim-plug +"============================================================================== + +" plugins list + call plug#begin('~/.vim/plugged') + Plug 'sheerun/vim-polyglot' " A ton of language syntax + Plug 'morhetz/gruvbox' " Gruvbox theme + Plug 'sickill/vim-monokai' " Monokai Theme + Plug 'arcticicestudio/nord-vim' " Nord theme + Plug 'itchyny/lightline.vim' " vim status bar + Plug 'shinchu/lightline-gruvbox.vim' " Gruvbox theme for status line + Plug 'airblade/vim-gitgutter' " Git gutter + Plug 'lilydjwg/colorizer' " Displays the colors in file + Plug 'jiangmiao/auto-pairs' " Auto create bracket/parens/quote pairs + Plug 'vim-syntastic/syntastic' " coding-errors checker + Plug 'neoclide/coc.nvim', {'branch': 'release'} " Lanuage server integrations + Plug 'tpope/vim-fugitive' " git wrapper + Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } " golang plugin for vim + Plug 'Yggdroot/indentLine' " Indentation LInes + Plug 'junegunn/fzf' " Fuzzy search + Plug 'junegunn/fzf.vim' " Fuzzy search + Plug 'francoiscabrol/ranger.vim' " Ranger f + Plug 'scrooloose/nerdtree' " NerdTree - File tree (ctr-n) + Plug 'Xuyuanp/nerdtree-git-plugin' " Git support in NERDTree + Plug 'ryanoasis/vim-devicons' " File Icons - Always load last + call plug#end() + +" Set encoding to utf8 +set encoding=UTF-8 + +" install plugins automatically +autocmd VimEnter * + \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | q + \| endif + +" remove unused plugins automatically +autocmd VimEnter * + \ if len(filter(split(globpath(g:plug_home, '*'), "\n"), 'isdirectory(v:val)')) + \ > len(filter(values(g:plugs), 'stridx(v:val.dir, g:plug_home) == 0')) + \| PlugClean | q + \| endif + +" Toggle NerdTree with Ctrl+n +map :NERDTreeToggle +" Open fzf Files search +map :Files +" Open file search +map :BLines +" Indent Guides auto start +let g:indent_guides_enable_on_vim_startup = 1 + + +" Tab navigation and creation +map :tabnew +noremap :tabn +noremap :tabp + +" Insert mode navigation Alt+hjkl +imap +imap +imap +imap + +" Set line heighlight on by default +set cursorline +" Set Clipboard to system +set clipboard=unnamedplus +" Enable mouse use in all modes +set mouse=a +" Auto highlight similar words when staying on a word after .5 sec +set updatetime=500 +augroup highlight_current_word + au! + au CursorHold * + \ if ( expand("%") != 'NERD_tree_1' ) + \ | :exec 'match Search /\V\<' . expand('') . '\>/' + \ | endif +augroup END + + +"============================================================================== +" Sync NERDTree with file +"============================================================================== +" Check if NERDTree is open or active +function! IsNERDTreeOpen() + return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) +endfunction + +" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable +" file, and we're not in vimdiff +function! SyncTree() + if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff + NERDTreeFind + wincmd p + endif +endfunction + +" Highlight currently open buffer in NERDTree +autocmd BufRead * call SyncTree() + +" Nerdtree show hidden files +let NERDTreeShowHidden=1 +" Dont show .git folder +let NERDTreeIgnore=['\.git$'] + +"============================================================================== +" Theme settings +"============================================================================== + +"let &t_8f = "\[38;2;%lu;%lu;%lum" +"let &t_8b = "\[48;2;%lu;%lu;%lum" +"set termguicolors +" Theme +colorscheme nord +" Setting dark mode +"set background=dark + +"============================================================================== +" line number +"============================================================================== + +" set relative number on visual mode and absolute number on insert mode +set relativenumber +set number +autocmd InsertEnter * :set number norelativenumber +autocmd InsertLeave * :set nonumber relativenumber + +" set backgrond and font color of line number +highlight LineNr ctermfg=grey ctermbg=black + +" open files at the last remember line +if has("autocmd") + au BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") + \| exe "normal! g`\"" + \| endif +endif + + +"============================================================================== +" TAB settings +"============================================================================== + +"filetype plugin indent on + +" show existing tab with 4 spaces width +set tabstop=4 + +" when indenting with '>', use 4 spaces width +set shiftwidth=4 + +" On pressing tab, insert 4 spaces +set expandtab + + +"============================================================================== +" set column +"============================================================================== + +" set coding style limit at 80 chars +set colorcolumn=80 + +"============================================================================== +" mouse settings +"============================================================================== + +" enable mouse +set mouse=a + +"============================================================================== +" file title +"============================================================================== + +" always show current file title +set title + + +"============================================================================== +" normal mode mapping +"============================================================================== + +" mapping capsLock to ctrl +map CapsLock Ctrl + + +" this package is extending % to <> and other sifferent closures +packadd! matchit +:let b:match_words = '<:>,:' + +" enable ci( of all sorts to work from outside the parenthese +nnoremap ci( %ci( +nnoremap ci[ %ci[ +nnoremap ci{ %ci{ +" NOTE: use 'normal' for <> because % is not a regular vim command (package) +nnoremap ci< :normal %ci< + +" enable di( of all sorts to work from outside the parenthese +nnoremap di( %di( +nnoremap di[ %di[ +nnoremap di{ %di{ +" NOTE: use 'normal' for <> because % is not a regular vim command (package) +nnoremap di< :normal %di< + +" easy navigation on split screen +nnoremap +nnoremap +nnoremap +nnoremap + +" easy access to buffers +" \l : list buffers +" \b \f \g : go back/forward/last-used +" \d : delete buffer +nnoremap l :ls +nnoremap b :bp +nnoremap f :bn +nnoremap g :e# +nnoremap c :bd + +" make 'Y' act like 'D' and 'C' instead of working like 'yy' +nnoremap Y y$ + +"============================================================================== +" search settings +"============================================================================== + +" ignore CASE in search +set ignorecase + +" higlight search matches +set hlsearch + +"============================================================================== +" vim && tmux +"============================================================================== + +" makes split-navigation act differently when in vim\tmux +" in both cases navigation will be done with ctr + hjkl (without tmux prefix) +if exists('$TMUX') + function! TmuxOrSplitSwitch(wincmd, tmuxdir) + let previous_winnr = winnr() + silent! execute "wincmd " . a:wincmd + if previous_winnr == winnr() + call system("tmux select-pane -" . a:tmuxdir) + redraw! + endif + endfunction + + let previous_title = substitute(system("tmux display-message -p '#{pane_title}'"), '\n', '', '') + let &t_ti = "\]2;vim\\\" . &t_ti + let &t_te = "\]2;". previous_title . "\\\" . &t_te + + nnoremap :call TmuxOrSplitSwitch('h', 'L') + nnoremap :call TmuxOrSplitSwitch('j', 'D') + nnoremap :call TmuxOrSplitSwitch('k', 'U') + nnoremap :call TmuxOrSplitSwitch('l', 'R') +else + map h + map j + map k + map l +endif + + + +"============================================================================== +" split settings +"============================================================================== +" +" more intuitive default splits + set splitbelow + set splitright + +"============================================================================== +" Lightline.vim plugin & status line +"============================================================================== + +" make status line always visible +set laststatus=2 + +" NOTE: 'FugitiveHead' is 'vim-fugitive' plugin's function and depend on it +" configure lightline.vim status line +let g:lightline = { + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'FugitiveHead', + \ 'filename': 'LightlineFilename', + \ }, + \ } +" lightline colorscheme +let g:lightline.colorscheme = 'nord' +" function to get the filename from vim to lightline.vim +function! LightlineFilename() + return &filetype ==# 'vimfiler' ? vimfiler#get_status_string() : + \ &filetype ==# 'unite' ? unite#get_status_string() : + \ &filetype ==# 'vimshell' ? vimshell#get_status_string() : + \ expand('%') !=# '' ? expand('%') : '[No Name]' +endfunction + +let g:unite_force_overwrite_statusline = 0 +let g:vimfiler_force_overwrite_statusline = 0 +let g:vimshell_force_overwrite_statusline = 0 + +" actually this have no effect when lightline.vim plugin is installed +set statusline+=%f "relative path (use %F for absolute path) +set statusline+=%m "modified flag +set statusline+=%= "left/right separator +set statusline+=%l/%L "cursor line/total lines +set statusline+=\ %P "percent through file + +"============================================================================== +" Spelling settings +"============================================================================== + +" make spell checker underline errors with vim 'set spell' command +" Note: must appear after the last line that is altering colorscheme +hi clear SpellBad +hi SpellBad cterm=underline + +"============================================================================== +" Delete settings +"============================================================================== + +" make backspace always erase in insert mode and not only new inputs +set backspace=indent,eol,start + +"============================================================================== +" Fold settings +"============================================================================== + +set foldmethod=marker + + +"============================================================================== +" swp files +"============================================================================== + +" Don't use swapfile +set noswapfile + diff --git a/files/dotfiles/zshrc b/files/dotfiles/zshrc new file mode 100644 index 0000000..899b508 --- /dev/null +++ b/files/dotfiles/zshrc @@ -0,0 +1,116 @@ +# If you come from bash you might have to change your $PATH. + +# Path to your oh-my-zsh installation. +export ZSH="/home/sdayan/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +#ZSH_THEME="robbyrussell" +ZSH_THEME="gnzh" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) +# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git sudo) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Common +source ~/.shellconfig/common.sh +# Aliases +source ~/.shellconfig/aliases.sh +# Environment Vars +source ~/.shellconfig/environment.sh +# Functions +source ~/.shellconfig/functions.sh + + + + +# Start tmux if not in a session +# [ -z $TMUX ] && ( tmux a || tmux ) diff --git a/files/fonts/hack_nerd_font.ttf b/files/fonts/hack_nerd_font.ttf new file mode 100644 index 0000000..d770b83 Binary files /dev/null and b/files/fonts/hack_nerd_font.ttf differ diff --git a/roles/.empty b/roles/.empty new file mode 100644 index 0000000..e69de29 diff --git a/roles/alacritty_user/tasks/main.yml b/roles/alacritty_user/tasks/main.yml new file mode 100644 index 0000000..062532e --- /dev/null +++ b/roles/alacritty_user/tasks/main.yml @@ -0,0 +1,25 @@ +- name: Install Alacritty PPA (Debian Based) + become: true + apt_repository: + repo: "ppa:aslatter/ppa" + validate_certs: no + state: present + when: ansible_facts['os_family'] == "Debian" + +- name: Install Alacritty + become: true + package: + name: alacritty + state: latest + +- name: Setting up alacritty config file + copy: + src: dotfiles/alacritty.yml + dest: ~/.alacritty.yml + +- name: "Setting Alacritty theme" + ansible.builtin.lineinfile: + path: "~/.alacritty.yml" + regexp: "^colors:" + line: "colors: *{{theme}}" + diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml new file mode 100644 index 0000000..9d4dc26 --- /dev/null +++ b/roles/base/tasks/main.yml @@ -0,0 +1,58 @@ +- name: Installing packages + become: true + package: + name: + - curl + - bat + - wget + - git +# - podman + state: present + +- name: Copy gitconfig base + copy: + src: dotfiles/gitconfig + dest: ~/.gitconfig + force: no + +- name: Copy zsh config + copy: + src: dotfiles/zshrc + dest: ~/.zshrc + force: yes + +- name: Verifying shell config folder + file: + path: ~/.shellconfig + state: directory + +- name: Sync Common shell settings... + copy: + src: dotfiles/shellconfig/common.sh + dest: ~/.shellconfig/common.sh + force: yes + +- name: verify Bat (better Cat) theme + 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 + dest: ~/.shellconfig/aliases.sh + force: no + +- name: Copy shell functions + copy: + src: dotfiles/shellconfig/functions.sh + dest: ~/.shellconfig/functions.sh + force: no + +- name: Copy shell environment + copy: + src: dotfiles/shellconfig/environment.sh + dest: ~/.shellconfig/environment.sh + force: no + diff --git a/roles/fonts/tasks/main.yml b/roles/fonts/tasks/main.yml new file mode 100644 index 0000000..271a9ab --- /dev/null +++ b/roles/fonts/tasks/main.yml @@ -0,0 +1,15 @@ +- name: Preparing for Hack Nerd font installation + become: true + file: + path: /usr/share/fonts/hack + state: directory + owner: root + group: root + +- name: Installing Hack Nerd Font + become: true + copy: + src: fonts/hack_nerd_font.ttf + dest: /usr/share/fonts/hack/hack_nerd_font.ttf + owner: root + group: root diff --git a/roles/lsd_user/tasks/main.yml b/roles/lsd_user/tasks/main.yml new file mode 100644 index 0000000..a795b07 --- /dev/null +++ b/roles/lsd_user/tasks/main.yml @@ -0,0 +1,27 @@ +- name: Install LSDeluxe (RHEL family) + become: true + package: + name: lsd + state: present + when: ansible_facts['os_family'] == "RedHat" + +- name: Check if lsd is installed (Debian Family) + command: dpkg-query -W lsd + register: lsd_package_check + failed_when: lsd_package_check.rc > 1 + changed_when: lsd_package_check.rc == 1 + when: ansible_facts['os_family'] == "Debian" + + +#===== Debian Only - No need for ansible_disrebution +- name: Download LSDeluxe deb file (Debian Family) + get_url: + url: https://github.com/Peltoche/lsd/releases/download/0.20.1/lsd-musl_0.20.1_amd64.deb + dest: ./lsd.deb + when: lsd_package_check.changed + +- name: Install LSDeluxe Deb file (Debian Family) + become: true + apt: + deb: ./lsd.deb + when: lsd_package_check.changed diff --git a/roles/tmux_user/tasks/main.yml b/roles/tmux_user/tasks/main.yml new file mode 100644 index 0000000..ed6137d --- /dev/null +++ b/roles/tmux_user/tasks/main.yml @@ -0,0 +1,16 @@ +- name: Install tmux + become: true + package: + name: tmux + state: latest + +- name: Install tmux plugin manager + git: + repo: https://github.com/tmux-plugins/tpm + dest: ~/.tmux/plugins/tpm + update: yes + +- name: Copy tmux config file + copy: + src: dotfiles/tmux.conf + dest: ~/.tmux.conf diff --git a/roles/vim_user/tasks/main.yml b/roles/vim_user/tasks/main.yml new file mode 100644 index 0000000..8465d64 --- /dev/null +++ b/roles/vim_user/tasks/main.yml @@ -0,0 +1,32 @@ +- name: Install vim + become: true + package: + name: vim + state: latest + +- name: Prepare vim... + file: + path: ~/.vim/autoload + state: directory + +- name: Install vim Plug + get_url: + url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + dest: ~/.vim/autoload/plug.vim + +- name: "Copy vimrc file" + copy: + src: dotfiles/vimrc + dest: "~/.vimrc" + +- name: "Set vim colorscheme" + ansible.builtin.lineinfile: + path: "~/.vimrc" + regexp: "^colorscheme" + line: "colorscheme {{theme}}" + +- name: "Set vim lightline colorscheme" + ansible.builtin.lineinfile: + path: "~/.vimrc" + regexp: "^let g:lightline.colorscheme" + line: "let g:lightline.colorscheme = '{{theme}}'" diff --git a/workstation.yml b/workstation.yml new file mode 100644 index 0000000..ed8e05e --- /dev/null +++ b/workstation.yml @@ -0,0 +1,11 @@ +- hosts: localhost + vars: + # Theme options: monokai, gruvbox, nord + theme: nord + roles: + - base + - fonts + - tmux_user + - vim_user + - alacritty_user + - lsd_user