From 5fabe2f985a417d8d562c83984cd4fa0993276bb Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 2 Jan 2024 11:12:32 +0000 Subject: [PATCH] chore: adding some additional configs --- main.yml | 11 ++++++++--- roles/bash_profile/files/bash_profile | 26 ++++++++++++++++++++++++++ roles/bash_profile/tasks/main.yml | 6 ++++++ roles/tmux/files/tmux.conf | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 roles/bash_profile/files/bash_profile create mode 100644 roles/bash_profile/tasks/main.yml diff --git a/main.yml b/main.yml index 31ecebe..2e3abf9 100644 --- a/main.yml +++ b/main.yml @@ -1,9 +1,14 @@ --- - name: Setup Dev Environment hosts: localhost - become: yes - become_user: root + connection: local + gather_facts: yes +# become: yes +# become_user: root roles: + # TODO make this optional +# - update_packages - git + - bash_profile - tmux - - vim + - vim \ No newline at end of file diff --git a/roles/bash_profile/files/bash_profile b/roles/bash_profile/files/bash_profile new file mode 100644 index 0000000..050b442 --- /dev/null +++ b/roles/bash_profile/files/bash_profile @@ -0,0 +1,26 @@ + #!/usr/bin/env bash + +# https://github.com/chatton/dotfiles/blob/master/.bash_profile + + # enable fzf with reverse search + [ -f ~/.fzf.bash ] && source ~/.fzf.bash + +function _setup_go() { + source /home/cianhatton/.gvm/scripts/gvm + gvm use go1.21 +} + +# gh pr list | fzf | awk '{print $1}' | gh pr view --web +function _parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' +} + +# display git branch in the terminal prompt +export PS1='\[\e[1;91m\][\w]\[\e[0m\]\[\e[32m\]$(_parse_git_branch)\[\e[00m\]$ ' + + +function setup() { + ansible-playbook /home/cianhatton/checkouts/ansible-dev-environment/main.yml +} + +_setup_go \ No newline at end of file diff --git a/roles/bash_profile/tasks/main.yml b/roles/bash_profile/tasks/main.yml new file mode 100644 index 0000000..58770bf --- /dev/null +++ b/roles/bash_profile/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Copy tmux conf. + ansible.builtin.copy: + src: bash_profile + dest: /home/cianhatton/.bash_profile + mode: '0644' \ No newline at end of file diff --git a/roles/tmux/files/tmux.conf b/roles/tmux/files/tmux.conf index c2e5f81..30259dc 100644 --- a/roles/tmux/files/tmux.conf +++ b/roles/tmux/files/tmux.conf @@ -26,4 +26,4 @@ bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." # Set new panes to open in current directory bind c new-window -c "#{pane_current_path}" bind '"' split-window -c "#{pane_current_path}" -bind % split-window -h -c "#{pane_current_path}" \ No newline at end of file +bind % split-window -h -c "#{pane_current_path}"