diff --git a/tasks/build/alacritty.yml b/tasks/build/alacritty.yml index d691803..9d25e5a 100644 --- a/tasks/build/alacritty.yml +++ b/tasks/build/alacritty.yml @@ -6,8 +6,8 @@ - cargo - install - --root - - /usr/local + - "{{ pkgconfig_alacritty.install_prefix }}" - --git - - https://github.com/alacritty/alacritty.git + - "{{ pkgconfig_alacritty.git_repo }}" - --tag - - "v{{ _alacritty.version }}" + - "v{{ pkgconfig_alacritty.version }}" diff --git a/tasks/build/nerdfonts.yml b/tasks/build/nerdfonts.yml index 1ef0817..d965baf 100644 --- a/tasks/build/nerdfonts.yml +++ b/tasks/build/nerdfonts.yml @@ -6,31 +6,31 @@ - name: set install path for non-system installs ansible.builtin.set_fact: nerdfonts_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts" - when: not _nerdfonts.nerdfonts_system_install + when: not pkgconfig_nerdfonts.system_install - name: set install path for system wide installs ansible.builtin.set_fact: nerdfonts_install_path: "/usr/local/share/fonts" - when: _nerdfonts.nerdfonts_system_install + when: pkgconfig_nerdfonts.system_install - name: create nerdfonts directories ansible.builtin.file: - path: "{{ nerdfonts_install_path }}/{{ font.name }}" + path: "{{ nerdfonts_install_path }}/{{ font }}" state: directory - become: "{{ _nerdfonts.nerdfonts_system_install }}" - loop: "{{ nerdfonts }}" + become: "{{ pkgconfig_nerdfonts.system_install }}" + loop: "{{ pkgconfig_nerdfonts.install }}" loop_control: loop_var: font register: nerdfont_result - name: Download and extract nerdfonts ansible.builtin.unarchive: - creates: "{{ nerdfonts_install_path }}/{{ font.name }}/README.md" - src: "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/{{ font.name }}.tar.xz" - dest: "{{ nerdfonts_install_path }}/{{ font.name }}" + creates: "{{ nerdfonts_install_path }}/{{ font }}/README.md" + src: "{{ pkgconfig_nerdfonts.base_url }}/{{ font }}.tar.xz" + dest: "{{ nerdfonts_install_path }}/{{ font }}" remote_src: true when: nerdfont_result is changed become: nerdfonts_system_install - loop: "{{ _nerdfonts.fonts }}" + loop: "{{ pkgconfig_nerdfonts.install }}" loop_control: loop_var: font diff --git a/tasks/pkgs/air.yml b/tasks/pkgs/air.yml index 242ef25..c59754a 100644 --- a/tasks/pkgs/air.yml +++ b/tasks/pkgs/air.yml @@ -1,3 +1,8 @@ +--- +- ansible.builtin.include_tasks: + file: pkgs/go.yml + when: pkgconfig_go not defined + - name: add to gopkgs set_fact: gopkgs: "{{ gopkgs + ['github.com/air-verse/air@latest'] }}" diff --git a/tasks/pkgs/alacritty.yml b/tasks/pkgs/alacritty.yml index 7eaa34a..ad1e117 100644 --- a/tasks/pkgs/alacritty.yml +++ b/tasks/pkgs/alacritty.yml @@ -3,8 +3,7 @@ file: alacritty.yml name: _alacritty - ansible.builtin.set_fact: - pkgconfig: - alacritty: "{{ _alacritty | ansible.builtin.combine(pkgconfig.alacritty) }}" + pkgconfig_alacritty: "{{ _alacritty | ansible.builtin.combine(pkgconfig.alacritty) }}" - name: linux based installation when: ansible_system == 'Linux' @@ -12,23 +11,14 @@ - name: install rust and cargo ansible.builtin.include_tasks: file: "pkgs/rust.yml" - tags: - - rust - - dependency + when: pkgconfig_rust not defined - name: append to pkgs set_fact: - syspkgs: "{{ syspkgs + pkgconfig.alacritty.build_deps[ansible_distribution] }}" + syspkgs: "{{ syspkgs + pkgconfig_alacritty.build_deps[ansible_distribution] }}" srcpkgs: "{{ srcpkgs + [ 'alacritty' ] }}" - tags: - - syspkgs - - srcpkgs - name: append alacritty to caskpkgs set_fact: caskpkgs: "{{ caskpkgs + [ 'alacritty' ] }}" when: ansible_system == 'Darwin' - tags: - - MacOS - - brew - - package diff --git a/tasks/pkgs/ansible-language-server.yml b/tasks/pkgs/ansible-language-server.yml index 9c68361..9e8c0ec 100644 --- a/tasks/pkgs/ansible-language-server.yml +++ b/tasks/pkgs/ansible-language-server.yml @@ -1,3 +1,8 @@ +--- +- ansible.builtin.include_tasks: + file: pkgs/nodejs.yml + when: pkgconfig_nodejs not defined + - name: add to npmpkgs set_fact: npmpkgs: "{{ npmpkgs + ['@ansible/ansible-language-server'] }}" diff --git a/tasks/pkgs/carapace.yml b/tasks/pkgs/carapace.yml index fb8ab5a..3e8fa79 100644 --- a/tasks/pkgs/carapace.yml +++ b/tasks/pkgs/carapace.yml @@ -3,8 +3,7 @@ file: carapace.yml name: _carapace - ansible.builtin.set_fact: - pkgconfig: - carapace: "{{ _carapace | ansible.builtin.combine(pkgconfig.carapace) }}" + pkgconfig_carapace: "{{ _carapace | ansible.builtin.combine(pkgconfig.carapace) }}" - name: enable carapace yum repository ansible.builtin.yum_repository: @@ -27,4 +26,4 @@ - name: add carapace to syspkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + pkgconfig.carapace.pkgs[ansible_system] }}" + syspkgs: "{{ syspkgs + pkgconfig_carapace.pkgs[ansible_system] }}" diff --git a/tasks/pkgs/consul.yml b/tasks/pkgs/consul.yml index 8c66369..c0b5cbb 100644 --- a/tasks/pkgs/consul.yml +++ b/tasks/pkgs/consul.yml @@ -3,12 +3,13 @@ - name: ensure hashicorp repo is active ansible.builtin.include_tasks: file: "pkgs/hashicorp_repo.yml" + when: pkgconfig_hashicorp is not defined - name: append to syspkgs set_fact: - syspkgs: "{{ syspkgs + [ pkgconfig.hashicorp.consul[ansible_system] ] }}" + syspkgs: "{{ syspkgs + [ pkgconfig_hashicorp.consul[ansible_system] ] }}" when: ansible_system == 'Linux' - set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.hashicorp.consul[ansible_system] ] }}" + tappkgs: "{{ tappkgs + [ pkgconfig_hashicorp.consul[ansible_system] ] }}" when: ansible_system == 'Darwin' diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index ff5bc20..73d5ace 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -4,17 +4,11 @@ block: - ansible.builtin.include_tasks: file: "pkgs/terra_repo.yml" - tags: - - dependency - - package - - terra - - syspkgs + when: pkgconfig_terrarepo is not defined - name: append to pkgs set_fact: syspkgs: "{{ syspkgs + [ 'ghostty' ] }}" - tags: - - syspkgs - name: no ghostty for this system when: @@ -27,8 +21,3 @@ when: ansible_distribution == 'MacOSX' set_fact: caskpkgs: "{{ caskpkgs + [ 'ghostty' ] }}" - tags: - - MacOS - - brew - - package - - terminal diff --git a/tasks/pkgs/git.yml b/tasks/pkgs/git.yml index f69f0be..968cbc9 100644 --- a/tasks/pkgs/git.yml +++ b/tasks/pkgs/git.yml @@ -3,14 +3,12 @@ file: git.yml name: _git - ansible.builtin.set_fact: - pkgconfig: - git: "{{ _git | ansible.builtin.combine(pkgconfig.git) }}" + pkgconfig_git: "{{ _git | ansible.builtin.combine(pkgconfig.git) }}" - ansible.builtin.set_fact: - pkgconfig: - git: + pkgconfig_git: pkgs: "{{ pkgconfig.git.pkgs[ansible_system] }}" - name: append to pkgs set_fact: - syspkgs: "{{ syspkgs + pkgconfig.git.pkgs }}" + syspkgs: "{{ syspkgs + pkgconfig_git.pkgs }}" diff --git a/tasks/pkgs/go.yml b/tasks/pkgs/go.yml index 3b0b04d..a9ba397 100644 --- a/tasks/pkgs/go.yml +++ b/tasks/pkgs/go.yml @@ -3,8 +3,7 @@ file: go.yml name: _go - ansible.builtin.set_fact: - pkgconfig: - go: "{{ _go | ansible.builtin.combine(pkgconfig.go) }}" + pkgconfig_go: "{{ _go | ansible.builtin.combine(pkgconfig.go) }}" - name: append to pkgs set_fact: diff --git a/tasks/pkgs/gopls.yml b/tasks/pkgs/gopls.yml index 988ff32..5adae6c 100644 --- a/tasks/pkgs/gopls.yml +++ b/tasks/pkgs/gopls.yml @@ -1,3 +1,8 @@ +--- +- ansible.builtin.include_tasks: + file: pkgs/go.yml + when: pkgconfig_go is not defined + - name: add to gopkgs set_fact: gopkgs: "{{ gopkgs + ['golang.org/x/tools/gopls@latest'] }}" diff --git a/tasks/pkgs/hashicorp_repo.yml b/tasks/pkgs/hashicorp_repo.yml index 706f30e..13fa333 100644 --- a/tasks/pkgs/hashicorp_repo.yml +++ b/tasks/pkgs/hashicorp_repo.yml @@ -3,8 +3,7 @@ file: hashicorp_repo.yml name: _hashicorp - ansible.builtin.set_fact: - pkgconfig: - hashicorp: "{{ _hashicorp | ansible.builtin.combine(pkgonfig.hashicorp) }}" + pkgconfig_hashicorp: "{{ _hashicorp | ansible.builtin.combine(pkgonfig.hashicorp) }}" - name: RedHat repository when: ansible_os_family == 'RedHat' @@ -16,7 +15,7 @@ - ansible_distribution_major_version|int >= 41 ansible.builtin.command: creates: /etc/yum.repos.d/hashicorp.repo - cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.hashicorp.Linux.Fedora.repo }}" + cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig_hashicorp.Linux.Fedora.repo }}" - name: enable hashicorp repo for fedora <41 become: true @@ -25,7 +24,7 @@ - ansible_distribution_major_version|int < 41 ansible.builtin.command: creates: /etc/yum.repos.d/hashicorp.repo - cmd: "dnf config-manager --add-repo {{ pkgconfig.hashicorp.Linux.Fedora.repo }}" + cmd: "dnf config-manager --add-repo {{ pkgconfig_hashicorp.Linux.Fedora.repo }}" - name: enable hashicorp repo for RHEL like distribution become: true @@ -33,7 +32,7 @@ - ansible_distribution != 'Fedora' ansible.builtin.command: creates: /etc/yum.repos.d/hashicorp.repo - cmd: "dnf config-manager --add-repo {{ pkgconfig.hashicorp.Linux.RedHat.repo }}" + cmd: "dnf config-manager --add-repo {{ pkgconfig_hashicorp.Linux.RedHat.repo }}" - name: Debian based repository when: ansible_os_family == 'Debian' @@ -60,7 +59,7 @@ - name: enable hasicorp repo for debian ansible.builtin.apt_repository: - repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}" + repo: "{{ pkgconfig_hashicorp.Linux.Debian.repo }}" state: present update_cache: false diff --git a/tasks/pkgs/kitty.yml b/tasks/pkgs/kitty.yml index a78c9bb..9754ea0 100644 --- a/tasks/pkgs/kitty.yml +++ b/tasks/pkgs/kitty.yml @@ -3,9 +3,8 @@ file: kitty.yml name: _kitty - ansible.builtin.set_fact: - pkgconfig: - kitty: "{{ _kitty | ansible.builtin.combine(pkgconfig.kitty) }}" + pkgconfig_kitty: "{{ _kitty | ansible.builtin.combine(pkgconfig.kitty) }}" - name: add to syspkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + pkgconfig.kitty.pkgs[ansible_system] }}" + syspkgs: "{{ syspkgs + pkgconfig_kitty.pkgs[ansible_system] }}" diff --git a/tasks/pkgs/neovide.yml b/tasks/pkgs/neovide.yml index b1225e8..225a232 100644 --- a/tasks/pkgs/neovide.yml +++ b/tasks/pkgs/neovide.yml @@ -3,18 +3,17 @@ file: neovide.yml name: _neovide - ansible.builtin.set_fact: - pkgconfig: - neovide: "{{ _neovide | ansible.builtin.combine(pkgconfig.neovide) }}" + pkgconfig_neovide: "{{ _neovide | ansible.builtin.combine(pkgconfig.neovide) }}" - ansible.builtin.include_tasks: file: "pkgs/{{ pkgdep }}.yml" - loop: "{{ pkgconfig.neovide.local_deps }}" + loop: "{{ pkgconfig_neovide.local_deps }}" loop_control: loop_var: pkgdep - name: append to pkgs when: ansible_system == 'Linux' set_fact: - syspkgs: "{{ syspkgs + pkgconfig.neovide.pkgdeps[ansible_os_family] }}" + syspkgs: "{{ syspkgs + pkgconfig_neovide.pkgdeps[ansible_os_family] }}" srcpkgs: "{{ srcpkgs + [ 'neovide' ] }}" - name: append neovide to caskpkgs diff --git a/tasks/pkgs/neovim.yml b/tasks/pkgs/neovim.yml index 0598322..5ebc235 100644 --- a/tasks/pkgs/neovim.yml +++ b/tasks/pkgs/neovim.yml @@ -3,15 +3,14 @@ file: neovim.yml name: _neovim - ansible.builtin.set_fact: - pkgconfig: - neovim: "{{ _neovim | ansible.builtin.combine(pkgconfig.neovim) }}" + pkgconfig_neovim: "{{ _neovim | ansible.builtin.combine(pkgconfig.neovim) }}" - name: append neovim to srcpkgs - when: not pkgconfig.neovim.use_syspkg + when: not pkgconfig_neovim.use_syspkg set_fact: srcpkgs: "{{ srcpkgs + ['neovim'] }}" - name: append neovim to syspkgs - when: pkgconfig.neovim.use_syspkg + when: pkgconfig_neovim.use_syspkg set_fact: syspkgs: "{{ syspkgs + ['neovim'] }}" diff --git a/tasks/pkgs/nerdfonts.yml b/tasks/pkgs/nerdfonts.yml index 3a1dbbd..713899a 100644 --- a/tasks/pkgs/nerdfonts.yml +++ b/tasks/pkgs/nerdfonts.yml @@ -3,8 +3,7 @@ file: nerdfonts.yml name: _nerdfonts - ansible.builtin.set_fact: - pkgconfig: - nerdfonts: "{{ _nerdfonts | ansible.builtin.combine(pkgconfig.nerdfons) }}" + pkgconfig_nerdfonts: "{{ _nerdfonts | ansible.builtin.combine(pkgconfig.nerdfons) }}" - name: append to srcpkgs when: ansible_system == 'Linux' @@ -14,7 +13,7 @@ - name: append to caskpkgs when: ansible_system == 'Darwin' set_fact: - caskpkgs: "{{ caskpkgs + [ 'font-' + font.brew + '-nerd-font' ] }}" - loop: "{{ pkgconfig.nerdfonts.fonts }}" + caskpkgs: "{{ caskpkgs + [ pkgconfig_nerdfonts[font].brew ] }}" + loop: "{{ pkgconfig_nerdfonts.install }}" loop_control: loop_var: font diff --git a/vars/alacritty.yml b/vars/alacritty.yml index 38548fe..5dff5b1 100644 --- a/vars/alacritty.yml +++ b/vars/alacritty.yml @@ -1,5 +1,6 @@ --- version: 0.15.0 +install_prefix: /usr/local # variables that aren't really configuration build_deps: @@ -18,3 +19,5 @@ build_deps: - libxcb-xfixes0-dev - libxkbcommon-dev - python3 + +git_repo: https://github.com/alacritty/alacritty.git diff --git a/vars/nerdfonts.yml b/vars/nerdfonts.yml index fc0b731..54b82ee 100644 --- a/vars/nerdfonts.yml +++ b/vars/nerdfonts.yml @@ -146,3 +146,5 @@ fonts: brew: font-victor-mono-nerd-font ZedMono: brew: font-zed-mono-nerd-font + +base_url: https://github.com/ryanoasis/nerd-fonts/releases/latest/download