aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2023-09-10 12:01:02 -0500
committerAaditya Dhruv <[email protected]>2023-09-10 12:01:02 -0500
commitdefd4bc9331fca1f9c59906e86221696cea3a832 (patch)
tree30bd804ea8580e2a450f357396a91c6f5d8f8b83
parent61469981d54bb1bc8349e4708829199cd93ba12a (diff)
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
-rw-r--r--src/config/files/shell/.vimrc6
-rw-r--r--src/config/files/shell/.zshrc11
-rw-r--r--src/config/tasks/main.yaml62
-rw-r--r--src/config/vars/main.yaml17
4 files changed, 93 insertions, 3 deletions
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 <C-Down> :tablast<CR>
nnoremap <C-S-Right> :tabmove +1<CR>
nnoremap <C-S-Left> :tabmove -1<CR>
map <F1> :NERDTreeTabsToggle<CR>
+noremap <C-f> :Files <CR>
xnoremap <C-c> :s/^/\/\/ <CR>
nnoremap <Tab> >>
nnoremap <S-Tab> <<
@@ -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