Files
ansible_role_package/tasks/build/nerdfonts.yml
Matthew Stobbs c62d4e1977 restructuring for easier maintenance
- creating src packages when things can't be installed via
  actual system package
- neovim srcpkg is being worked on now
2025-01-19 14:10:41 -07:00

34 lines
1.1 KiB
YAML

# Install nerdfonts for each platform
---
- name: set install path for non-system installs
ansible.builtin.set_fact:
nerdfont_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts"
when: not nerdfonts_system_install
- name: set install path for system wide installs
ansible.builtin.set_fact:
nerdfont_install_path: "/usr/local/share/fonts"
when: nerdfonts_system_install
- name: create nerdfonts directories
ansible.builtin.file:
path: "{{ nerdfonts_install_path }}/{{ font.name }}"
state: directory
become: nerdfonts_system_install
loop: "{{ nerdfonts }}"
loop_control:
loop_var: font
register: nerdfont_result
- name: Download and extract nerdfonts
ansible.builtin.unarchive:
creates: "{{ nerdfont_install_path }}/{{ font.name }}/README.md"
src: "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/{{ font.name }}.tar.xz"
dest: "{{ nerdfont_install_path }}/{{ font.name }}"
remote_src: true
when: nerdfont_result is changed
become: nerdfonts_system_install
loop: "{{ nerdfonts }}"
loop_control:
loop_var: font