From 29e0b21a998d830fbe6b82bb3d8f7c4d2e987393 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 19:21:12 -0700 Subject: [PATCH 01/10] Apply the dotfiles role --- Ansible/local.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Ansible/local.yml diff --git a/Ansible/local.yml b/Ansible/local.yml new file mode 100644 index 0000000..f18a2d6 --- /dev/null +++ b/Ansible/local.yml @@ -0,0 +1,7 @@ +--- +- name: Local + hosts: localhost + tasks: + - name: Set up dotfiles + ansible.builtin.include_role: + name: dotfiles From 65182a7c520a057c3a9af9ec03f010c7b760c9ec Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 19:34:50 -0700 Subject: [PATCH 02/10] Move neovim config to dotfiles role --- .../roles/dotfiles/files/neovim}/UltiSnips/lua.snippets | 0 .../roles/dotfiles/files/neovim}/UltiSnips/python.snippets | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/css.lua | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/gitcommit.vim | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/gohtmltmpl.lua | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/lua.lua | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/python.lua | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/rust.lua | 0 .../roles/dotfiles/files/neovim}/after/ftplugin/zsh.lua | 0 .../roles/dotfiles/files/neovim}/after/plugin/gitgutter.lua | 0 .../roles/dotfiles/files/neovim}/after/plugin/treesitter.lua | 0 .../roles/dotfiles/files/neovim}/after/syntax/css.vim | 0 .../roles/dotfiles/files/neovim}/ftdetect/gohtmltmpl.lua | 0 .../nvim => Ansible/roles/dotfiles/files/neovim}/ftdetect/zsh.lua | 0 {config/nvim => Ansible/roles/dotfiles/files/neovim}/init.lua | 0 .../roles/dotfiles/files/neovim}/lua/autocommands.lua | 0 .../nvim => Ansible/roles/dotfiles/files/neovim}/lua/colors.lua | 0 .../roles/dotfiles/files/neovim}/lua/configuration.lua | 0 .../roles/dotfiles/files/neovim}/lua/diagnostics.lua | 0 {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/gui.lua | 0 {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/keys.lua | 0 {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/lsp.lua | 0 .../roles/dotfiles/files/neovim}/lua/treesitter.lua | 0 .../roles/dotfiles/files/neovim}/syntax/gocsstmpl.vim | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/UltiSnips/lua.snippets (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/UltiSnips/python.snippets (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/css.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/gitcommit.vim (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/gohtmltmpl.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/lua.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/python.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/rust.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/ftplugin/zsh.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/plugin/gitgutter.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/plugin/treesitter.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/after/syntax/css.vim (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/ftdetect/gohtmltmpl.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/ftdetect/zsh.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/init.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/autocommands.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/colors.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/configuration.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/diagnostics.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/gui.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/keys.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/lsp.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/lua/treesitter.lua (100%) rename {config/nvim => Ansible/roles/dotfiles/files/neovim}/syntax/gocsstmpl.vim (100%) diff --git a/config/nvim/UltiSnips/lua.snippets b/Ansible/roles/dotfiles/files/neovim/UltiSnips/lua.snippets similarity index 100% rename from config/nvim/UltiSnips/lua.snippets rename to Ansible/roles/dotfiles/files/neovim/UltiSnips/lua.snippets diff --git a/config/nvim/UltiSnips/python.snippets b/Ansible/roles/dotfiles/files/neovim/UltiSnips/python.snippets similarity index 100% rename from config/nvim/UltiSnips/python.snippets rename to Ansible/roles/dotfiles/files/neovim/UltiSnips/python.snippets diff --git a/config/nvim/after/ftplugin/css.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/css.lua similarity index 100% rename from config/nvim/after/ftplugin/css.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/css.lua diff --git a/config/nvim/after/ftplugin/gitcommit.vim b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/gitcommit.vim similarity index 100% rename from config/nvim/after/ftplugin/gitcommit.vim rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/gitcommit.vim diff --git a/config/nvim/after/ftplugin/gohtmltmpl.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/gohtmltmpl.lua similarity index 100% rename from config/nvim/after/ftplugin/gohtmltmpl.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/gohtmltmpl.lua diff --git a/config/nvim/after/ftplugin/lua.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/lua.lua similarity index 100% rename from config/nvim/after/ftplugin/lua.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/lua.lua diff --git a/config/nvim/after/ftplugin/python.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/python.lua similarity index 100% rename from config/nvim/after/ftplugin/python.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/python.lua diff --git a/config/nvim/after/ftplugin/rust.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/rust.lua similarity index 100% rename from config/nvim/after/ftplugin/rust.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/rust.lua diff --git a/config/nvim/after/ftplugin/zsh.lua b/Ansible/roles/dotfiles/files/neovim/after/ftplugin/zsh.lua similarity index 100% rename from config/nvim/after/ftplugin/zsh.lua rename to Ansible/roles/dotfiles/files/neovim/after/ftplugin/zsh.lua diff --git a/config/nvim/after/plugin/gitgutter.lua b/Ansible/roles/dotfiles/files/neovim/after/plugin/gitgutter.lua similarity index 100% rename from config/nvim/after/plugin/gitgutter.lua rename to Ansible/roles/dotfiles/files/neovim/after/plugin/gitgutter.lua diff --git a/config/nvim/after/plugin/treesitter.lua b/Ansible/roles/dotfiles/files/neovim/after/plugin/treesitter.lua similarity index 100% rename from config/nvim/after/plugin/treesitter.lua rename to Ansible/roles/dotfiles/files/neovim/after/plugin/treesitter.lua diff --git a/config/nvim/after/syntax/css.vim b/Ansible/roles/dotfiles/files/neovim/after/syntax/css.vim similarity index 100% rename from config/nvim/after/syntax/css.vim rename to Ansible/roles/dotfiles/files/neovim/after/syntax/css.vim diff --git a/config/nvim/ftdetect/gohtmltmpl.lua b/Ansible/roles/dotfiles/files/neovim/ftdetect/gohtmltmpl.lua similarity index 100% rename from config/nvim/ftdetect/gohtmltmpl.lua rename to Ansible/roles/dotfiles/files/neovim/ftdetect/gohtmltmpl.lua diff --git a/config/nvim/ftdetect/zsh.lua b/Ansible/roles/dotfiles/files/neovim/ftdetect/zsh.lua similarity index 100% rename from config/nvim/ftdetect/zsh.lua rename to Ansible/roles/dotfiles/files/neovim/ftdetect/zsh.lua diff --git a/config/nvim/init.lua b/Ansible/roles/dotfiles/files/neovim/init.lua similarity index 100% rename from config/nvim/init.lua rename to Ansible/roles/dotfiles/files/neovim/init.lua diff --git a/config/nvim/lua/autocommands.lua b/Ansible/roles/dotfiles/files/neovim/lua/autocommands.lua similarity index 100% rename from config/nvim/lua/autocommands.lua rename to Ansible/roles/dotfiles/files/neovim/lua/autocommands.lua diff --git a/config/nvim/lua/colors.lua b/Ansible/roles/dotfiles/files/neovim/lua/colors.lua similarity index 100% rename from config/nvim/lua/colors.lua rename to Ansible/roles/dotfiles/files/neovim/lua/colors.lua diff --git a/config/nvim/lua/configuration.lua b/Ansible/roles/dotfiles/files/neovim/lua/configuration.lua similarity index 100% rename from config/nvim/lua/configuration.lua rename to Ansible/roles/dotfiles/files/neovim/lua/configuration.lua diff --git a/config/nvim/lua/diagnostics.lua b/Ansible/roles/dotfiles/files/neovim/lua/diagnostics.lua similarity index 100% rename from config/nvim/lua/diagnostics.lua rename to Ansible/roles/dotfiles/files/neovim/lua/diagnostics.lua diff --git a/config/nvim/lua/gui.lua b/Ansible/roles/dotfiles/files/neovim/lua/gui.lua similarity index 100% rename from config/nvim/lua/gui.lua rename to Ansible/roles/dotfiles/files/neovim/lua/gui.lua diff --git a/config/nvim/lua/keys.lua b/Ansible/roles/dotfiles/files/neovim/lua/keys.lua similarity index 100% rename from config/nvim/lua/keys.lua rename to Ansible/roles/dotfiles/files/neovim/lua/keys.lua diff --git a/config/nvim/lua/lsp.lua b/Ansible/roles/dotfiles/files/neovim/lua/lsp.lua similarity index 100% rename from config/nvim/lua/lsp.lua rename to Ansible/roles/dotfiles/files/neovim/lua/lsp.lua diff --git a/config/nvim/lua/treesitter.lua b/Ansible/roles/dotfiles/files/neovim/lua/treesitter.lua similarity index 100% rename from config/nvim/lua/treesitter.lua rename to Ansible/roles/dotfiles/files/neovim/lua/treesitter.lua diff --git a/config/nvim/syntax/gocsstmpl.vim b/Ansible/roles/dotfiles/files/neovim/syntax/gocsstmpl.vim similarity index 100% rename from config/nvim/syntax/gocsstmpl.vim rename to Ansible/roles/dotfiles/files/neovim/syntax/gocsstmpl.vim From f7a29e3c1d41641c443af27717ce867e75522dbb Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 19:37:41 -0700 Subject: [PATCH 03/10] Add vim setup --- .../roles/dotfiles/files/vim/vimrc | 0 Ansible/roles/dotfiles/tasks/main.yml | 3 ++ Ansible/roles/dotfiles/tasks/vim.yml | 30 +++++++++++++++++++ 3 files changed, 33 insertions(+) rename vimrc => Ansible/roles/dotfiles/files/vim/vimrc (100%) create mode 100644 Ansible/roles/dotfiles/tasks/vim.yml diff --git a/vimrc b/Ansible/roles/dotfiles/files/vim/vimrc similarity index 100% rename from vimrc rename to Ansible/roles/dotfiles/files/vim/vimrc diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index 3c2ba07..0ca08a1 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -1,3 +1,6 @@ --- - name: ZSH ansible.builtin.include_tasks: zsh.yml + +- name: Vim + ansible.builtin.include_tasks: vim.yml diff --git a/Ansible/roles/dotfiles/tasks/vim.yml b/Ansible/roles/dotfiles/tasks/vim.yml new file mode 100644 index 0000000..94c6321 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/vim.yml @@ -0,0 +1,30 @@ +--- +- name: (vim) Link plain vim config + ansible.builtin.file: + path: ~/.vimrc + src: "{{ role_path }}/files/vim/vimrc" + state: link + force: true + +- name: (neovim) Create standard config directory + ansible.builtin.file: + path: ~/.config + state: directory + +- name: (neovim) Link config + ansible.builtin.file: + path: ~/.config/nvim + src: "{{ role_path }}/files/neovim" + state: link + force: true + +- name: (neovim) Create .local directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + loop: + - ~/.local/share/nvim + - ~/.local/state/nvim + - ~/.local/state/nvim/backup + - ~/.local/state/nvim/swap + - ~/.local/state/nvim/undo From bc4b9f80892754027ac6bbf5a3d366727b63757e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 19:48:38 -0700 Subject: [PATCH 04/10] Move git configs into dotfiles role --- .../roles/dotfiles/files/git/gitconfig | 0 .../roles/dotfiles/files/git/gitignore | 0 Ansible/roles/dotfiles/tasks/git.yml | 10 ++++++++++ Ansible/roles/dotfiles/tasks/main.yml | 3 +++ 4 files changed, 13 insertions(+) rename gitconfig => Ansible/roles/dotfiles/files/git/gitconfig (100%) rename gitignore => Ansible/roles/dotfiles/files/git/gitignore (100%) create mode 100644 Ansible/roles/dotfiles/tasks/git.yml diff --git a/gitconfig b/Ansible/roles/dotfiles/files/git/gitconfig similarity index 100% rename from gitconfig rename to Ansible/roles/dotfiles/files/git/gitconfig diff --git a/gitignore b/Ansible/roles/dotfiles/files/git/gitignore similarity index 100% rename from gitignore rename to Ansible/roles/dotfiles/files/git/gitignore diff --git a/Ansible/roles/dotfiles/tasks/git.yml b/Ansible/roles/dotfiles/tasks/git.yml new file mode 100644 index 0000000..b326569 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/git.yml @@ -0,0 +1,10 @@ +--- +- name: (git) Link global git configs + ansible.builtin.file: + path: ~/.{{ item }} + src: "{{ role_path }}/files/git/{{ item }}" + state: link + force: true + loop: + - gitconfig + - gitignore diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index 0ca08a1..d2b5810 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -4,3 +4,6 @@ - name: Vim ansible.builtin.include_tasks: vim.yml + +- name: Git + ansible.builtin.include_tasks: git.yml From 01312752fc40f7a235a72b1ee25035414e140570 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 19:55:27 -0700 Subject: [PATCH 05/10] Move tmux and screen configs to Ansible role --- .../roles/dotfiles/files/screen/screenrc | 0 .../roles/dotfiles/files/tmux/tmux.conf | 0 Ansible/roles/dotfiles/tasks/main.yml | 6 ++++++ Ansible/roles/dotfiles/tasks/shell_utilities.yml | 16 ++++++++++++++++ 4 files changed, 22 insertions(+) rename screenrc => Ansible/roles/dotfiles/files/screen/screenrc (100%) rename tmux.conf => Ansible/roles/dotfiles/files/tmux/tmux.conf (100%) create mode 100644 Ansible/roles/dotfiles/tasks/shell_utilities.yml diff --git a/screenrc b/Ansible/roles/dotfiles/files/screen/screenrc similarity index 100% rename from screenrc rename to Ansible/roles/dotfiles/files/screen/screenrc diff --git a/tmux.conf b/Ansible/roles/dotfiles/files/tmux/tmux.conf similarity index 100% rename from tmux.conf rename to Ansible/roles/dotfiles/files/tmux/tmux.conf diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index d2b5810..f8ff950 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -1,9 +1,15 @@ --- - name: ZSH ansible.builtin.include_tasks: zsh.yml + tags: dotfiles_zsh - name: Vim ansible.builtin.include_tasks: vim.yml + tags: dotfiles_vim - name: Git ansible.builtin.include_tasks: git.yml + tags: dotfiles_git + +- name: Shell utilities + ansible.builtin.include_tasks: shell_utilities.yml diff --git a/Ansible/roles/dotfiles/tasks/shell_utilities.yml b/Ansible/roles/dotfiles/tasks/shell_utilities.yml new file mode 100644 index 0000000..197a1ee --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/shell_utilities.yml @@ -0,0 +1,16 @@ +--- +- name: (tmux) Link tmux.conf + ansible.builtin.file: + path: ~/.tmux.conf + src: "{{ role_path }}/files/tmux/tmux.conf" + state: link + force: true + tags: dotfiles_tmux + +- name: (screen) Link screenrc + ansible.builtin.file: + path: ~/.screenrc + src: "{{ role_path }}/files/screen/screenrc" + state: link + force: true + tags: dotfiles_screen From 398c6f2d18fb5565adeee658f48d416392b60f0f Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 20:08:35 -0700 Subject: [PATCH 06/10] Move the rest of the zsh functions into the dotfiles role --- .../files/zsh/functions}/append_to_path | 0 .../files/zsh/functions}/binary_exists | 0 .../files/zsh/functions}/connect_ssh_agent | 0 .../zsh/functions}/darwin-icloud-drive-path | 0 .../functions}/darwin/darwin-hardware-model | 0 .../zsh/functions}/darwin/darwin-os-build | 0 .../zsh/functions}/darwin/darwin-os-version | 0 .../darwin_configure_screenshots_directory | 0 .../files/zsh/functions}/darwin_init_once | 0 .../files/zsh/functions}/do_init_functions | 0 .../dotfiles/files/zsh/functions}/finder | 0 .../roles/dotfiles/files/zsh/functions}/g | 0 .../files/zsh/functions}/homebrew-prefix | 0 .../files/zsh/functions}/import_cacert | 0 .../zsh/functions}/init_app_environments | 0 .../files/zsh/functions}/init_configure_ls | 0 .../files/zsh/functions}/init_profile_darwin | 0 .../functions}/init_profile_darwin_say_hello | 0 .../files/zsh/functions}/init_rc_aliases | 0 .../functions}/init_rc_configure_completion | 0 .../zsh/functions}/init_rc_configure_prompt | 0 .../zsh/functions}/init_rc_configure_zle | 0 .../files/zsh/functions}/init_rc_fpath_darwin | 0 .../files/zsh/functions}/init_rc_linux | 0 .../files/zsh/functions}/init_rc_tilde_paths | 0 .../files/zsh/functions/init_site_environment | 9 ++++++++ .../zsh/functions/init_website_environment | 9 ++++++++ .../dotfiles/files/zsh/functions}/init_xcode | 0 .../files/zsh/functions}/init_zsh_functions | 0 .../files/zsh/functions}/init_zsh_history | 0 .../files/zsh/functions}/init_zsh_options | 0 .../files/zsh/functions}/list_tmux_sessions | 0 .../dotfiles/files/zsh/functions}/load_module | 0 .../files/zsh/functions}/neovim_init_once | 0 .../dotfiles/files/zsh/functions}/nethack | 0 .../dotfiles/files/zsh/functions}/open-xcode | 0 .../files/zsh/functions}/prepend_to_path | 0 .../files/zsh/functions}/prompt_colorize | 0 .../zsh/functions}/prompt_loquacious_setup | 0 .../files/zsh/functions}/refresh_system_tags | 0 .../files/zsh/functions}/setup-cpython | 0 .../files/zsh/functions}/setup_android | 0 .../dotfiles/files/zsh/functions}/solarized | 0 .../roles/dotfiles/files/zsh/functions}/up | 0 .../dotfiles/files/zsh/functions}/update-path | 0 .../dotfiles/files/zsh/functions/weeknotes | 15 +++++++++++++ Ansible/roles/dotfiles/files/zsh/zshenv | 4 +++- Ansible/roles/dotfiles/tasks/zsh.yml | 22 ++++++++++++------- 48 files changed, 50 insertions(+), 9 deletions(-) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/append_to_path (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/binary_exists (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/connect_ssh_agent (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin-icloud-drive-path (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin/darwin-hardware-model (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin/darwin-os-build (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin/darwin-os-version (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin_configure_screenshots_directory (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/darwin_init_once (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/do_init_functions (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/finder (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/g (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/homebrew-prefix (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/import_cacert (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_app_environments (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_configure_ls (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_profile_darwin (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_profile_darwin_say_hello (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_aliases (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_configure_completion (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_configure_prompt (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_configure_zle (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_fpath_darwin (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_linux (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_rc_tilde_paths (100%) create mode 100644 Ansible/roles/dotfiles/files/zsh/functions/init_site_environment create mode 100644 Ansible/roles/dotfiles/files/zsh/functions/init_website_environment rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_xcode (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_zsh_functions (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_zsh_history (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/init_zsh_options (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/list_tmux_sessions (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/load_module (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/neovim_init_once (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/nethack (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/open-xcode (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/prepend_to_path (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/prompt_colorize (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/prompt_loquacious_setup (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/refresh_system_tags (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/setup-cpython (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/setup_android (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/solarized (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/up (100%) rename {zsh/func => Ansible/roles/dotfiles/files/zsh/functions}/update-path (100%) create mode 100644 Ansible/roles/dotfiles/files/zsh/functions/weeknotes diff --git a/zsh/func/append_to_path b/Ansible/roles/dotfiles/files/zsh/functions/append_to_path similarity index 100% rename from zsh/func/append_to_path rename to Ansible/roles/dotfiles/files/zsh/functions/append_to_path diff --git a/zsh/func/binary_exists b/Ansible/roles/dotfiles/files/zsh/functions/binary_exists similarity index 100% rename from zsh/func/binary_exists rename to Ansible/roles/dotfiles/files/zsh/functions/binary_exists diff --git a/zsh/func/connect_ssh_agent b/Ansible/roles/dotfiles/files/zsh/functions/connect_ssh_agent similarity index 100% rename from zsh/func/connect_ssh_agent rename to Ansible/roles/dotfiles/files/zsh/functions/connect_ssh_agent diff --git a/zsh/func/darwin-icloud-drive-path b/Ansible/roles/dotfiles/files/zsh/functions/darwin-icloud-drive-path similarity index 100% rename from zsh/func/darwin-icloud-drive-path rename to Ansible/roles/dotfiles/files/zsh/functions/darwin-icloud-drive-path diff --git a/zsh/func/darwin/darwin-hardware-model b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-hardware-model similarity index 100% rename from zsh/func/darwin/darwin-hardware-model rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-hardware-model diff --git a/zsh/func/darwin/darwin-os-build b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-build similarity index 100% rename from zsh/func/darwin/darwin-os-build rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-build diff --git a/zsh/func/darwin/darwin-os-version b/Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-version similarity index 100% rename from zsh/func/darwin/darwin-os-version rename to Ansible/roles/dotfiles/files/zsh/functions/darwin/darwin-os-version diff --git a/zsh/func/darwin_configure_screenshots_directory b/Ansible/roles/dotfiles/files/zsh/functions/darwin_configure_screenshots_directory similarity index 100% rename from zsh/func/darwin_configure_screenshots_directory rename to Ansible/roles/dotfiles/files/zsh/functions/darwin_configure_screenshots_directory diff --git a/zsh/func/darwin_init_once b/Ansible/roles/dotfiles/files/zsh/functions/darwin_init_once similarity index 100% rename from zsh/func/darwin_init_once rename to Ansible/roles/dotfiles/files/zsh/functions/darwin_init_once diff --git a/zsh/func/do_init_functions b/Ansible/roles/dotfiles/files/zsh/functions/do_init_functions similarity index 100% rename from zsh/func/do_init_functions rename to Ansible/roles/dotfiles/files/zsh/functions/do_init_functions diff --git a/zsh/func/finder b/Ansible/roles/dotfiles/files/zsh/functions/finder similarity index 100% rename from zsh/func/finder rename to Ansible/roles/dotfiles/files/zsh/functions/finder diff --git a/zsh/func/g b/Ansible/roles/dotfiles/files/zsh/functions/g similarity index 100% rename from zsh/func/g rename to Ansible/roles/dotfiles/files/zsh/functions/g diff --git a/zsh/func/homebrew-prefix b/Ansible/roles/dotfiles/files/zsh/functions/homebrew-prefix similarity index 100% rename from zsh/func/homebrew-prefix rename to Ansible/roles/dotfiles/files/zsh/functions/homebrew-prefix diff --git a/zsh/func/import_cacert b/Ansible/roles/dotfiles/files/zsh/functions/import_cacert similarity index 100% rename from zsh/func/import_cacert rename to Ansible/roles/dotfiles/files/zsh/functions/import_cacert diff --git a/zsh/func/init_app_environments b/Ansible/roles/dotfiles/files/zsh/functions/init_app_environments similarity index 100% rename from zsh/func/init_app_environments rename to Ansible/roles/dotfiles/files/zsh/functions/init_app_environments diff --git a/zsh/func/init_configure_ls b/Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls similarity index 100% rename from zsh/func/init_configure_ls rename to Ansible/roles/dotfiles/files/zsh/functions/init_configure_ls diff --git a/zsh/func/init_profile_darwin b/Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin similarity index 100% rename from zsh/func/init_profile_darwin rename to Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin diff --git a/zsh/func/init_profile_darwin_say_hello b/Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin_say_hello similarity index 100% rename from zsh/func/init_profile_darwin_say_hello rename to Ansible/roles/dotfiles/files/zsh/functions/init_profile_darwin_say_hello diff --git a/zsh/func/init_rc_aliases b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_aliases similarity index 100% rename from zsh/func/init_rc_aliases rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_aliases diff --git a/zsh/func/init_rc_configure_completion b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_completion similarity index 100% rename from zsh/func/init_rc_configure_completion rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_completion diff --git a/zsh/func/init_rc_configure_prompt b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_prompt similarity index 100% rename from zsh/func/init_rc_configure_prompt rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_prompt diff --git a/zsh/func/init_rc_configure_zle b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_zle similarity index 100% rename from zsh/func/init_rc_configure_zle rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_configure_zle diff --git a/zsh/func/init_rc_fpath_darwin b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_fpath_darwin similarity index 100% rename from zsh/func/init_rc_fpath_darwin rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_fpath_darwin diff --git a/zsh/func/init_rc_linux b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_linux similarity index 100% rename from zsh/func/init_rc_linux rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_linux diff --git a/zsh/func/init_rc_tilde_paths b/Ansible/roles/dotfiles/files/zsh/functions/init_rc_tilde_paths similarity index 100% rename from zsh/func/init_rc_tilde_paths rename to Ansible/roles/dotfiles/files/zsh/functions/init_rc_tilde_paths diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment b/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment new file mode 100644 index 0000000..b4f382b --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_site_environment @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +# Eryn Wells + +function init_site_environments +{ + export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me" +} + +init_site_environments "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment b/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment new file mode 100644 index 0000000..e1f791e --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/init_website_environment @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +# Eryn Wells + +function init_website_environments +{ + export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me" +} + +init_website_environments "$@" diff --git a/zsh/func/init_xcode b/Ansible/roles/dotfiles/files/zsh/functions/init_xcode similarity index 100% rename from zsh/func/init_xcode rename to Ansible/roles/dotfiles/files/zsh/functions/init_xcode diff --git a/zsh/func/init_zsh_functions b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_functions similarity index 100% rename from zsh/func/init_zsh_functions rename to Ansible/roles/dotfiles/files/zsh/functions/init_zsh_functions diff --git a/zsh/func/init_zsh_history b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_history similarity index 100% rename from zsh/func/init_zsh_history rename to Ansible/roles/dotfiles/files/zsh/functions/init_zsh_history diff --git a/zsh/func/init_zsh_options b/Ansible/roles/dotfiles/files/zsh/functions/init_zsh_options similarity index 100% rename from zsh/func/init_zsh_options rename to Ansible/roles/dotfiles/files/zsh/functions/init_zsh_options diff --git a/zsh/func/list_tmux_sessions b/Ansible/roles/dotfiles/files/zsh/functions/list_tmux_sessions similarity index 100% rename from zsh/func/list_tmux_sessions rename to Ansible/roles/dotfiles/files/zsh/functions/list_tmux_sessions diff --git a/zsh/func/load_module b/Ansible/roles/dotfiles/files/zsh/functions/load_module similarity index 100% rename from zsh/func/load_module rename to Ansible/roles/dotfiles/files/zsh/functions/load_module diff --git a/zsh/func/neovim_init_once b/Ansible/roles/dotfiles/files/zsh/functions/neovim_init_once similarity index 100% rename from zsh/func/neovim_init_once rename to Ansible/roles/dotfiles/files/zsh/functions/neovim_init_once diff --git a/zsh/func/nethack b/Ansible/roles/dotfiles/files/zsh/functions/nethack similarity index 100% rename from zsh/func/nethack rename to Ansible/roles/dotfiles/files/zsh/functions/nethack diff --git a/zsh/func/open-xcode b/Ansible/roles/dotfiles/files/zsh/functions/open-xcode similarity index 100% rename from zsh/func/open-xcode rename to Ansible/roles/dotfiles/files/zsh/functions/open-xcode diff --git a/zsh/func/prepend_to_path b/Ansible/roles/dotfiles/files/zsh/functions/prepend_to_path similarity index 100% rename from zsh/func/prepend_to_path rename to Ansible/roles/dotfiles/files/zsh/functions/prepend_to_path diff --git a/zsh/func/prompt_colorize b/Ansible/roles/dotfiles/files/zsh/functions/prompt_colorize similarity index 100% rename from zsh/func/prompt_colorize rename to Ansible/roles/dotfiles/files/zsh/functions/prompt_colorize diff --git a/zsh/func/prompt_loquacious_setup b/Ansible/roles/dotfiles/files/zsh/functions/prompt_loquacious_setup similarity index 100% rename from zsh/func/prompt_loquacious_setup rename to Ansible/roles/dotfiles/files/zsh/functions/prompt_loquacious_setup diff --git a/zsh/func/refresh_system_tags b/Ansible/roles/dotfiles/files/zsh/functions/refresh_system_tags similarity index 100% rename from zsh/func/refresh_system_tags rename to Ansible/roles/dotfiles/files/zsh/functions/refresh_system_tags diff --git a/zsh/func/setup-cpython b/Ansible/roles/dotfiles/files/zsh/functions/setup-cpython similarity index 100% rename from zsh/func/setup-cpython rename to Ansible/roles/dotfiles/files/zsh/functions/setup-cpython diff --git a/zsh/func/setup_android b/Ansible/roles/dotfiles/files/zsh/functions/setup_android similarity index 100% rename from zsh/func/setup_android rename to Ansible/roles/dotfiles/files/zsh/functions/setup_android diff --git a/zsh/func/solarized b/Ansible/roles/dotfiles/files/zsh/functions/solarized similarity index 100% rename from zsh/func/solarized rename to Ansible/roles/dotfiles/files/zsh/functions/solarized diff --git a/zsh/func/up b/Ansible/roles/dotfiles/files/zsh/functions/up similarity index 100% rename from zsh/func/up rename to Ansible/roles/dotfiles/files/zsh/functions/up diff --git a/zsh/func/update-path b/Ansible/roles/dotfiles/files/zsh/functions/update-path similarity index 100% rename from zsh/func/update-path rename to Ansible/roles/dotfiles/files/zsh/functions/update-path diff --git a/Ansible/roles/dotfiles/files/zsh/functions/weeknotes b/Ansible/roles/dotfiles/files/zsh/functions/weeknotes new file mode 100644 index 0000000..9381644 --- /dev/null +++ b/Ansible/roles/dotfiles/files/zsh/functions/weeknotes @@ -0,0 +1,15 @@ +#!/usr/bin/env zsh + +autoload init_website_environment + +function weeknotes +{ + init_website_environment + + YEAR=`date '+%Y'` + WEEK_NUMBER=`date '+%V'` + PAGE_PATH=blog/${YEAR}/weeknotes-${YEAR}w${WEEK_NUMBER}.md + UPCOMING_SUNDAY=`${ERYNWELLS_ME_SITE}/scripts/next_sunday.py` +} + +weeknotes "$@" diff --git a/Ansible/roles/dotfiles/files/zsh/zshenv b/Ansible/roles/dotfiles/files/zsh/zshenv index ead3559..540ecba 100644 --- a/Ansible/roles/dotfiles/files/zsh/zshenv +++ b/Ansible/roles/dotfiles/files/zsh/zshenv @@ -9,7 +9,9 @@ function init-env-fpath { local -r fpath_candidates=( \ "$HOME/.zsh/${SYS}-functions" \ - "$HOME/.zsh/func" \ + "$HOME/.zsh/init-env-functions" \ + "$HOME/.zsh/init-rc-functions" \ + "$HOME/.zsh/functions" \ ) # Process the array in reverse order (`Oa` means "descending index order", diff --git a/Ansible/roles/dotfiles/tasks/zsh.yml b/Ansible/roles/dotfiles/tasks/zsh.yml index 9301154..ef7dd22 100644 --- a/Ansible/roles/dotfiles/tasks/zsh.yml +++ b/Ansible/roles/dotfiles/tasks/zsh.yml @@ -1,5 +1,5 @@ --- -- name: (ZSH) Link startup files +- name: (zsh) Link startup files ansible.builtin.file: path: ~/.{{ item }} src: "{{ role_path }}/files/zsh/{{ item }}" @@ -10,16 +10,22 @@ - zshrc - zprofile -- name: (ZSH) Link env functions +- name: (zsh) Create zsh directories ansible.builtin.file: - path: ~/.zsh/init-env-functions - src: "{{ role_path }}/files/zsh/init-env-functions" - state: link + path: "{{ item }}" + state: directory force: true + loop: + - ~/.zsh + - ~/.zsh/cache -- name: (ZSH) Link rc functions +- name: (zsh) Link function library directories ansible.builtin.file: - path: ~/.zsh/init-rc-functions - src: "{{ role_path }}/files/zsh/init-rc-functions" + path: ~/.zsh/{{ item }} + src: "{{ role_path }}/files/zsh/{{ item }}" state: link force: true + loop: + - init-env-functions + - init-rc-functions + - functions From 6c6c7937c64890d657205faac913deb9602339c4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 20:19:48 -0700 Subject: [PATCH 07/10] Move mutt config to dotfiles role --- .../roles/dotfiles/files/mutt}/mailcap | 0 .../roles/dotfiles/files/mutt/muttrc | 10 ++++---- .../dotfiles/files/mutt}/view_attachment.sh | 0 Ansible/roles/dotfiles/tasks/main.yml | 3 +++ Ansible/roles/dotfiles/tasks/mutt.yml | 25 +++++++++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) rename {mutt => Ansible/roles/dotfiles/files/mutt}/mailcap (100%) rename muttrc => Ansible/roles/dotfiles/files/mutt/muttrc (92%) rename {mutt => Ansible/roles/dotfiles/files/mutt}/view_attachment.sh (100%) create mode 100644 Ansible/roles/dotfiles/tasks/mutt.yml diff --git a/mutt/mailcap b/Ansible/roles/dotfiles/files/mutt/mailcap similarity index 100% rename from mutt/mailcap rename to Ansible/roles/dotfiles/files/mutt/mailcap diff --git a/muttrc b/Ansible/roles/dotfiles/files/mutt/muttrc similarity index 92% rename from muttrc rename to Ansible/roles/dotfiles/files/mutt/muttrc index 6ec822c..19b0b9b 100644 --- a/muttrc +++ b/Ansible/roles/dotfiles/files/mutt/muttrc @@ -19,9 +19,9 @@ set timeout=300 set imap_keepalive=300 # Caching -set header_cache="~/.mutt/cache/headers" -set message_cachedir="~/.mutt/cache/bodies" -set certificate_file="~/.mutt/certificates" +set header_cache="~/.local/state/mutt/cache/headers" +set message_cachedir="~/.local/state/mutt/cache/bodies" +set certificate_file="~/.local/state/mutt/certificates" set use_from=yes set envelope_from=yes @@ -50,14 +50,14 @@ hdr_order Date: From: To: Cc: Subject: # Aliases set reverse_alias=yes -set alias_file="~/.mutt/aliases" +set alias_file="~/.config/mutt/aliases" # Composing and Sending set edit_headers=yes set include=yes # HTML email :( -set mailcap_path="~/.mutt/mailcap" +set mailcap_path="~/.config/mutt/mailcap" auto_view text/html alternative_order text/html text/plain text/enriched diff --git a/mutt/view_attachment.sh b/Ansible/roles/dotfiles/files/mutt/view_attachment.sh similarity index 100% rename from mutt/view_attachment.sh rename to Ansible/roles/dotfiles/files/mutt/view_attachment.sh diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index f8ff950..989d436 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -11,5 +11,8 @@ ansible.builtin.include_tasks: git.yml tags: dotfiles_git +- name: Mutt + ansible.builtin.include_tasks: mutt.yml + - name: Shell utilities ansible.builtin.include_tasks: shell_utilities.yml diff --git a/Ansible/roles/dotfiles/tasks/mutt.yml b/Ansible/roles/dotfiles/tasks/mutt.yml new file mode 100644 index 0000000..6cf777d --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/mutt.yml @@ -0,0 +1,25 @@ +--- +- name: (mutt) Link muttrc + ansible.builtin.file: + path: ~/.muttrc + src: "{{ role_path }}/files/mutt/muttrc" + state: link + force: true + +- name: (mutt) Make mutt config directory + ansible.builtin.file: + path: ~/.config/mutt + state: directory + force: true + +- name: (mutt) Link mailcap + ansible.builtin.file: + path: ~/.config/mutt/mailcap + src: "{{ role_path }}/files/mutt/mailcap" + state: link + force: true + +- name: (mutt) Create local state directory + ansible.builtin.file: + path: ~/.local/state/mutt + state: directory From 2c23fad3e8795a925c0ab7495b1a5eab1c792e3d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 2 Oct 2024 20:23:18 -0700 Subject: [PATCH 08/10] Move emacs config to dotfiles role --- emacs => Ansible/roles/dotfiles/files/emacs/emacs | 0 Ansible/roles/dotfiles/tasks/emacs.yml | 7 +++++++ Ansible/roles/dotfiles/tasks/main.yml | 5 +++++ 3 files changed, 12 insertions(+) rename emacs => Ansible/roles/dotfiles/files/emacs/emacs (100%) create mode 100644 Ansible/roles/dotfiles/tasks/emacs.yml diff --git a/emacs b/Ansible/roles/dotfiles/files/emacs/emacs similarity index 100% rename from emacs rename to Ansible/roles/dotfiles/files/emacs/emacs diff --git a/Ansible/roles/dotfiles/tasks/emacs.yml b/Ansible/roles/dotfiles/tasks/emacs.yml new file mode 100644 index 0000000..415cf08 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/emacs.yml @@ -0,0 +1,7 @@ +--- +- name: (emacs) Link emacs config + ansible.builtin.file: + path: ~/.emacs + src: "{{ role_path }}/files/emacs/emacs" + state: link + force: true diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index 989d436..aa1549c 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -7,12 +7,17 @@ ansible.builtin.include_tasks: vim.yml tags: dotfiles_vim +- name: Emacs + ansible.builtin.include_tasks: emacs.yml + tags: dotfiles_emacs + - name: Git ansible.builtin.include_tasks: git.yml tags: dotfiles_git - name: Mutt ansible.builtin.include_tasks: mutt.yml + tags: dotfiles_mutt - name: Shell utilities ansible.builtin.include_tasks: shell_utilities.yml From 3b509c45d1a6012bb4a71571404f6e34d55d08c8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Thu, 3 Oct 2024 15:37:16 -0500 Subject: [PATCH 09/10] Move nethack config into dotfiles role --- .../roles/dotfiles/files/nethack/nethackrc | 0 Ansible/roles/dotfiles/tasks/main.yml | 3 +++ Ansible/roles/dotfiles/tasks/nethack.yml | 7 +++++++ 3 files changed, 10 insertions(+) rename nethackrc => Ansible/roles/dotfiles/files/nethack/nethackrc (100%) create mode 100644 Ansible/roles/dotfiles/tasks/nethack.yml diff --git a/nethackrc b/Ansible/roles/dotfiles/files/nethack/nethackrc similarity index 100% rename from nethackrc rename to Ansible/roles/dotfiles/files/nethack/nethackrc diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index aa1549c..e0d319a 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -21,3 +21,6 @@ - name: Shell utilities ansible.builtin.include_tasks: shell_utilities.yml + +- name: Nethack + ansible.builtin.include_tasks: nethack.yml diff --git a/Ansible/roles/dotfiles/tasks/nethack.yml b/Ansible/roles/dotfiles/tasks/nethack.yml new file mode 100644 index 0000000..485e20c --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/nethack.yml @@ -0,0 +1,7 @@ +--- +- name: (nethack) Link nethackrc + ansible.builtin.file: + path: ~/.nethackrc + src: "{{ role_path }}/files/nethack/nethackrc" + state: link + force: true From d6bb7ae7266bd3a45578f0b7eefe70d8522e6acb Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 8 Nov 2024 08:24:06 -0800 Subject: [PATCH 10/10] WIP --- Ansible/ansible.cfg | 16 +++++ Ansible/roles/dotfiles/handlers/main.yml | 4 ++ .../roles/dotfiles/tasks/darwin/bootstrap.yml | 3 + .../roles/dotfiles/tasks/darwin/homebrew.yml | 37 ++++++++++ Ansible/roles/dotfiles/tasks/dotfiles.yml | 28 ++++++++ Ansible/roles/dotfiles/tasks/main.yml | 37 ++++------ Ansible/roles/dotfiles/tasks/nethack.yml | 8 +++ Ansible/roles/dotfiles/tasks/packages.yml | 13 ++++ Ansible/roles/dotfiles/tasks/vim.yml | 3 + Ansible/roles/dotfiles/tasks/zsh.yml | 70 +++++++++++-------- Ansible/roles/dotfiles/vars/main.yml | 11 +++ 11 files changed, 179 insertions(+), 51 deletions(-) create mode 100644 Ansible/ansible.cfg create mode 100644 Ansible/roles/dotfiles/handlers/main.yml create mode 100644 Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml create mode 100644 Ansible/roles/dotfiles/tasks/darwin/homebrew.yml create mode 100644 Ansible/roles/dotfiles/tasks/dotfiles.yml create mode 100644 Ansible/roles/dotfiles/tasks/packages.yml create mode 100644 Ansible/roles/dotfiles/vars/main.yml diff --git a/Ansible/ansible.cfg b/Ansible/ansible.cfg new file mode 100644 index 0000000..1f7181c --- /dev/null +++ b/Ansible/ansible.cfg @@ -0,0 +1,16 @@ +[defaults] +bin_ansible_callbacks = True +callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer +remote_user = eryn +roles_path = roles +stdout_callback = community.general.yaml + +[connection] +pipelining = true + +[ssh_connection] +ssh_args = -o ControlMaster=auto -o ControlPersist=60s + +[vault] +username = ansible-infrastructure-vault +keyname = default diff --git a/Ansible/roles/dotfiles/handlers/main.yml b/Ansible/roles/dotfiles/handlers/main.yml new file mode 100644 index 0000000..dfc89e5 --- /dev/null +++ b/Ansible/roles/dotfiles/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Rediscover package manager + ansible.builtin.setup: + gather_subset: pkg_mgr diff --git a/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml b/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml new file mode 100644 index 0000000..0474ec1 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/darwin/bootstrap.yml @@ -0,0 +1,3 @@ +--- +- name: (macOS) Configure homebrew + ansible.builtin.include_tasks: homebrew.yml diff --git a/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml b/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml new file mode 100644 index 0000000..2ac20c6 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/darwin/homebrew.yml @@ -0,0 +1,37 @@ +--- +- name: (macOS | homebrew) Does the brew command exist? + ansible.builtin.stat: + path: /opt/homebrew/bin/brew + register: _dotfiles_homebrew_brew + +- name: (macOS | homebrew) Install Homebrew + when: not _dotfiles_homebrew_brew.stat.exists + block: + - name: (macOS | homebrew) Create temporary file for install script + ansible.builtin.tempfile: + state: file + prefix: homebrew-install + register: _dotfiles_homebrew_install_script + + - name: (macOS | homebrew) Set up homebrew + block: + - name: (macOS | homebrew) Fetch install script + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh + dest: "{{ _dotfiles_homebrew_install_script.path }}" + mode: "0644" + + - name: (macOS | homebrew) Run install script + ansible.builtin.command: + cmd: bash {{ _dotfiles_homebrew_install_script.path }} + environment: + NONINTERACTIVE: 1 + + - name: (macOS | homebrew) Gather package manager facts + ansible.builtin.setup: + gather_subset: pkg_mgr + always: + - name: (macOS | homebrew) Remove temporary install script + ansible.builtin.file: + path: "{{ _dotfiles_homebrew_install_script.path }}" + state: absent diff --git a/Ansible/roles/dotfiles/tasks/dotfiles.yml b/Ansible/roles/dotfiles/tasks/dotfiles.yml new file mode 100644 index 0000000..389ab23 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/dotfiles.yml @@ -0,0 +1,28 @@ +--- +- name: (dotfiles) ZSH + ansible.builtin.include_tasks: zsh.yml + tags: [ always, dotfiles_shell, dotfiles_zsh ] + +- name: (dotfiles) Vim + ansible.builtin.include_tasks: vim.yml + tags: [ always, dotfiles_vim ] + +- name: (dotfiles) Emacs + ansible.builtin.include_tasks: emacs.yml + tags: dotfiles_emacs + +- name: (dotfiles) Git + ansible.builtin.include_tasks: git.yml + tags: [ always, dotfiles_git ] + +- name: (dotfiles) Mutt + ansible.builtin.include_tasks: mutt.yml + tags: dotfiles_mutt + +- name: (dotfiles) Shell utilities + ansible.builtin.include_tasks: shell_utilities.yml + tags: dotfiles_shell + +- name: (dotfiles) Nethack + ansible.builtin.include_tasks: nethack.yml + tags: dotfiles_nethack diff --git a/Ansible/roles/dotfiles/tasks/main.yml b/Ansible/roles/dotfiles/tasks/main.yml index e0d319a..91fc42c 100644 --- a/Ansible/roles/dotfiles/tasks/main.yml +++ b/Ansible/roles/dotfiles/tasks/main.yml @@ -1,26 +1,17 @@ --- -- name: ZSH - ansible.builtin.include_tasks: zsh.yml - tags: dotfiles_zsh +- name: Bootstrap system + ansible.builtin.include_tasks: "{{ ansible_facts.os_family | lower }}/bootstrap.yml" -- name: Vim - ansible.builtin.include_tasks: vim.yml - tags: dotfiles_vim +#- name: Install packages +# ansible.builtin.include_tasks: packages.yml -- name: Emacs - ansible.builtin.include_tasks: emacs.yml - tags: dotfiles_emacs - -- name: Git - ansible.builtin.include_tasks: git.yml - tags: dotfiles_git - -- name: Mutt - ansible.builtin.include_tasks: mutt.yml - tags: dotfiles_mutt - -- name: Shell utilities - ansible.builtin.include_tasks: shell_utilities.yml - -- name: Nethack - ansible.builtin.include_tasks: nethack.yml +- name: Link dotfiles + ansible.builtin.include_tasks: dotfiles.yml + tags: + - dotfiles_git + - dotfiles_mutt + - dotfiles_neovim + - dotfiles_nethack + - dotfiles_shell + - dotfiles_vim + - dotfiles_zsh diff --git a/Ansible/roles/dotfiles/tasks/nethack.yml b/Ansible/roles/dotfiles/tasks/nethack.yml index 485e20c..d6e8951 100644 --- a/Ansible/roles/dotfiles/tasks/nethack.yml +++ b/Ansible/roles/dotfiles/tasks/nethack.yml @@ -1,4 +1,12 @@ --- +- name: (nethack) Install nethack package + ansible.builtin.package: + name: nethack + state: present + when: + - dotfiles_install_packages is defined + - "'nethack' in dotfiles_install_packages" + - name: (nethack) Link nethackrc ansible.builtin.file: path: ~/.nethackrc diff --git a/Ansible/roles/dotfiles/tasks/packages.yml b/Ansible/roles/dotfiles/tasks/packages.yml new file mode 100644 index 0000000..0642dc4 --- /dev/null +++ b/Ansible/roles/dotfiles/tasks/packages.yml @@ -0,0 +1,13 @@ +--- +- name: Install packages + become: "{{ _dotfiles_requires_become[ansible_facts.pkg_mgr] | default(true) }}" + vars: + package_names: _dotfiles_package_names[ansible_facts.pkg_mgr] + ansible.builtin.package: + name: > + {{ + package_names[package] | default(package) + for package + in (_dotfiles_core_packages + dotfiles_install_packages) + }} + state: present diff --git a/Ansible/roles/dotfiles/tasks/vim.yml b/Ansible/roles/dotfiles/tasks/vim.yml index 94c6321..e3ff49b 100644 --- a/Ansible/roles/dotfiles/tasks/vim.yml +++ b/Ansible/roles/dotfiles/tasks/vim.yml @@ -7,11 +7,13 @@ force: true - name: (neovim) Create standard config directory + tags: dotfiles_neovim ansible.builtin.file: path: ~/.config state: directory - name: (neovim) Link config + tags: dotfiles_neovim ansible.builtin.file: path: ~/.config/nvim src: "{{ role_path }}/files/neovim" @@ -19,6 +21,7 @@ force: true - name: (neovim) Create .local directories + tags: dotfiles_neovim ansible.builtin.file: path: "{{ item }}" state: directory diff --git a/Ansible/roles/dotfiles/tasks/zsh.yml b/Ansible/roles/dotfiles/tasks/zsh.yml index ef7dd22..c0b8570 100644 --- a/Ansible/roles/dotfiles/tasks/zsh.yml +++ b/Ansible/roles/dotfiles/tasks/zsh.yml @@ -1,31 +1,45 @@ --- -- name: (zsh) Link startup files - ansible.builtin.file: - path: ~/.{{ item }} - src: "{{ role_path }}/files/zsh/{{ item }}" - state: link - force: true - loop: - - zshenv - - zshrc - - zprofile +- name: (zsh) Find zsh binary + ansible.builtin.command: + cmd: sh -c 'which zsh' + register: _dotfiles_which_zsh -- name: (zsh) Create zsh directories - ansible.builtin.file: - path: "{{ item }}" - state: directory - force: true - loop: - - ~/.zsh - - ~/.zsh/cache +- name: (zsh) Configure zsh + when: (_dotfiles_which_zsh | length) > 0 + block: + - name: (zsh) Make zsh my shell + ansible.builtin.user: + name: "{{ ansible_user }}" + shell: "{{ _dotfiles_which_zsh.stdout }}" + state: present -- name: (zsh) Link function library directories - ansible.builtin.file: - path: ~/.zsh/{{ item }} - src: "{{ role_path }}/files/zsh/{{ item }}" - state: link - force: true - loop: - - init-env-functions - - init-rc-functions - - functions + - name: (zsh) Link startup files + ansible.builtin.file: + path: ~/.{{ item }} + src: "{{ role_path }}/files/zsh/{{ item }}" + state: link + force: true + loop: + - zshenv + - zshrc + - zprofile + + - name: (zsh) Create zsh directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + force: true + loop: + - ~/.zsh + - ~/.zsh/cache + + - name: (zsh) Link function library directories + ansible.builtin.file: + path: ~/.zsh/{{ item }} + src: "{{ role_path }}/files/zsh/{{ item }}" + state: link + force: true + loop: + - init-env-functions + - init-rc-functions + - functions diff --git a/Ansible/roles/dotfiles/vars/main.yml b/Ansible/roles/dotfiles/vars/main.yml new file mode 100644 index 0000000..de5b952 --- /dev/null +++ b/Ansible/roles/dotfiles/vars/main.yml @@ -0,0 +1,11 @@ +_dotfiles_core_packages: + - zsh + - git + - tmux + - neovim + +_dotfiles_package_names: + homebrew: + +_dotfiles_requires_become: + homebrew: false