commit b8503a8bee3843d46f2cccdae3acc0892776ebe4 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..2694b05 --- /dev/null +++ b/files/dotfiles/alacritty.yml @@ -0,0 +1,261 @@ +--- +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' } + # Base16 Nord 256 - alacritty color config + # arcticicestudio + nord: &nord + # Default colors + primary: + background: '0x2e3440' + foreground: '0xe5e9f0' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x2e3440' + cursor: '0xe5e9f0' + + # Normal colors + normal: + black: '0x2e3440' + red: '0xbf616a' + green: '0xa3be8c' + yellow: '0xebcb8b' + blue: '0x81a1c1' + magenta: '0xb48ead' + cyan: '0x88c0d0' + white: '0xe5e9f0' + + # Bright colors + bright: + black: '0x4c566a' + red: '0xbf616a' + green: '0xa3be8c' + yellow: '0xebcb8b' + blue: '0x81a1c1' + magenta: '0xb48ead' + cyan: '0x88c0d0' + white: '0x8fbcbb' + + indexed_colors: + - { index: 16, color: '0xd08770' } + - { index: 17, color: '0x5e81ac' } + - { index: 18, color: '0x3b4252' } + - { index: 19, color: '0x434c5e' } + - { index: 20, color: '0xd8dee9' } + - { index: 21, color: '0xeceff4' } + +colors: *gruvbox 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/tmux.conf b/files/dotfiles/tmux.conf new file mode 100644 index 0000000..9726a2c --- /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..90e7a63 --- /dev/null +++ b/files/dotfiles/vimrc @@ -0,0 +1,368 @@ +"============================================================================== +" 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.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 +" Setting dark mode +set background=dark +" Theme +colorscheme gruvbox + +"============================================================================== +" 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 + +" without this vim in tmux recive diffrent colors +set background=dark + +" 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 = 'monokai' +" 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 + +"============================================================================== +" vim-go settings +"============================================================================== + +" make go-autocompletion start automatically after pressing '.' +au Filetype go inoremap . . + +" fields and types highlight +let g:go_highlight_types = 1 +let g:go_highlight_extra_types = 1 " adds types like io.Reader, io.Writer etc +let g:go_highlight_fields = 1 + +" make vim add and remove imports automatically on saving +let g:go_fmt_command="goimports" + +" shows the under-cursor-object's signature (automatically run GoInfo) +let g:go_auto_type_info = 1 + +" fixing `pattern uses more memory than 'maxmempattern'` error +set mmp=5000 + + +"============================================================================== +" swp files +"============================================================================== + +" Don't use swapfile +set noswapfile + diff --git a/files/dotfiles/zshrc b/files/dotfiles/zshrc new file mode 100644 index 0000000..c47df00 --- /dev/null +++ b/files/dotfiles/zshrc @@ -0,0 +1,152 @@ +# If you come from bash you might have to change your $PATH. +export PATH=$HOME/Development/bin:$HOME/.local/bin:$HOME/bin:$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" + +# Aliases +alias spot=ncspot +alias :q=exit + + +#Minikube +export gittoken=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 +# source <(kubectl completion bash) +# source <(minikube completion bash) +source <(skipper completion) +export SERVICE_REPLICAS_COUNT=1 +export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + + +# Golang +export GOPROXY="https://proxy.golang.org,direct" +export GOPATH=/home/sdayan/Development +# New ls (lsd) +alias ls='lsd' + + +# Rust - Cargo +export PATH=/home/sdayan/.cargo/bin:$PATH + +# Run screenfetch +alias info=screenfetch +[[ /usr/bin/kubectl ]] && source <(kubectl completion zsh) + + +# cd aliases +alias cdservice="cd ~/Development/github.com/openshift/assisted-service" +alias f='printf "\033c"' + +# bat theme (New cat) $ bat --list-themes +gruvbox="gruvbox" +monokai="Monokai Extended" +nord="Nord" + +export BAT_THEME="$gruvbox" +alias cat=bat + + +# Editors - Default +export VISUAL=vimx; +export EDITOR=vimx; +alias vim=vimx + +# 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..e097185 --- /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_distribution in ["Debian", "Ubuntu"] + +- 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..c8b57fa --- /dev/null +++ b/roles/base/tasks/main.yml @@ -0,0 +1,16 @@ +- 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 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..7c06023 --- /dev/null +++ b/roles/lsd_user/tasks/main.yml @@ -0,0 +1,26 @@ +- name: Install LSDeluxe (RHEL family) + become: true + package: + name: lsd + state: present + when: ansible_distribution in ["Fedora", "CentOS", "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_distribution in ["Debian", "Ubuntu"] + +#===== 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..0c470d2 --- /dev/null +++ b/roles/vim_user/tasks/main.yml @@ -0,0 +1,27 @@ +- 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 theme" + ansible.builtin.lineinfile: + path: "~/.vimrc" + regexp: "^colorscheme" + line: "colorscheme {{theme}}" + diff --git a/workstation.yml b/workstation.yml new file mode 100644 index 0000000..2e7e635 --- /dev/null +++ b/workstation.yml @@ -0,0 +1,11 @@ +- hosts: localhost + vars: + # Theme options: monokai, gruvbox, nord + theme: gruvbox + roles: + - base + - fonts + - tmux_user + - vim_user + - alacritty_user + - lsd_user