From defd4bc9331fca1f9c59906e86221696cea3a832 Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Sun, 10 Sep 2023 12:01:02 -0500 Subject: Add config role to install dotfiles The config role will install the actual config files I use in the right directories based on the options in the main config.yaml --- src/config/files/shell/.vimrc | 6 +++-- src/config/files/shell/.zshrc | 11 +++++++- src/config/tasks/main.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++ src/config/vars/main.yaml | 17 ++++++++++++ 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 src/config/tasks/main.yaml create mode 100644 src/config/vars/main.yaml diff --git a/src/config/files/shell/.vimrc b/src/config/files/shell/.vimrc index 43ff606..658eac5 100644 --- a/src/config/files/shell/.vimrc +++ b/src/config/files/shell/.vimrc @@ -9,8 +9,8 @@ call vundle#begin() "call vundle#begin('~/some/path/here') set bs=2 -set ts=4 -set sw=4 +set ts=8 +set sw=8 set t_Co=256 set number set ruler @@ -23,6 +23,7 @@ nnoremap :tablast nnoremap :tabmove +1 nnoremap :tabmove -1 map :NERDTreeTabsToggle +noremap :Files xnoremap :s/^/\/\/ nnoremap >> nnoremap << @@ -46,6 +47,7 @@ Plugin 'sainnhe/gruvbox-material' Plugin 'sheerun/vim-polyglot' Plugin 'valloric/youcompleteme' Plugin 'junegunn/fzf' +Plugin 'junegunn/fzf.vim' Plugin 'iamcco/markdown-preview.nvim' " All of your Plugins must be added before the following line diff --git a/src/config/files/shell/.zshrc b/src/config/files/shell/.zshrc index b663bb3..ad4b8c0 100644 --- a/src/config/files/shell/.zshrc +++ b/src/config/files/shell/.zshrc @@ -82,7 +82,6 @@ ZSH_THEME="powerlevel10k/powerlevel10k" plugins=(git zsh-autosuggestions zsh-syntax-highlighting - ) source $ZSH/oh-my-zsh.sh @@ -120,3 +119,13 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +compdef _doctl doctl +export EDITOR="/usr/bin/nvim" +# Install Ruby Gems to ~/gems +export GEM_HOME="$HOME/.gems" +export PATH="$HOME/.gems/bin:$PATH" +export PATH="$HOME/.local/bin:$PATH" + +alias note="/bin/nvim /home/aaditya/Notes/general/$(date +'%d-%m-%y').md" +source <(kubectl completion zsh) +alias k=kubectl diff --git a/src/config/tasks/main.yaml b/src/config/tasks/main.yaml new file mode 100644 index 0000000..fe93e59 --- /dev/null +++ b/src/config/tasks/main.yaml @@ -0,0 +1,62 @@ +- name: Install shell items + block: + - name: Setup ZSH + ansible.builtin.dnf: + name: "zsh" + state: latest + - name: Setup oh-my-zsh + become: true + become_user: aaditya + ansible.builtin.shell: 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended' + + - name: Setup p10k, tmux and zshrc + ansible.builtin.copy: + src: shell/{{ item }} + dest: "/home/{{ config.username }}" + backup: yes + loop: + - .p10k.zsh + - .zshrc + - .tmux.conf + + - name: Setup vimrc and vim bundles + ansible.builtin.copy: + src: shell/{{ item }} + dest: "/home/{{ config.username }}" + backup: yes + loop: + - .vimrc + + - name: Setup vim/neovim directories + ansible.builtin.copy: + src: "{{ item }}" + dest: "/home/{{ config.username }}/.config" + backup: yes + loop: + - nvim + + when: 'config.config.install_shell' + +- name: Install Dotfiles (Wayland) + ansible.builtin.copy: + src: "{{ item }}" + dest: "/home/{{ config.username }}/.config/" + backup: yes + loop: "{{ config_wayland }}" + when: 'config.config.install_wayland' + +- name: Install Dotfiles (Xorg) + ansible.builtin.copy: + src: "{{ item }}" + dest: "/home/{{ config.username }}/.config/" + backup: yes + loop: "{{ config_xorg }}" + when: 'config.config.install_xorg' + +- name: Install Dotfiles (All) + ansible.builtin.copy: + src: "{{ item }}" + dest: "/home/{{ config.username }}/.config/" + backup: yes + loop: "{{ config_all }}" + when: "'config.config.install_xorg' or 'config.config.install_wayland'" diff --git a/src/config/vars/main.yaml b/src/config/vars/main.yaml new file mode 100644 index 0000000..6ed2229 --- /dev/null +++ b/src/config/vars/main.yaml @@ -0,0 +1,17 @@ +--- +misc: + - fonts + - fontconfig +config_wayland: + - hypr + - waybar +config_xorg: + - polybar + - bspwm + - sxhkd + - picom +config_all: + - dunst + - alacritty + - nvim + - i3lock -- cgit