doing nerdfonts

This commit is contained in:
Matthew Stobbs
2026-02-08 14:44:54 -07:00
parent b87fc8235e
commit 906603b6d4
3 changed files with 214 additions and 8 deletions

View File

@@ -2,17 +2,47 @@
---
- name: Add nerdfonts
when:
- nerdfonts_configured is undefined
- "'nerdfonts' in __configured"
block:
- name: Load nerdfonts config
ansible.builtin.include_tasks:
file: config/nerdfonts.yml
- name: Load nerdfonts list
ansible.builtin.include_vars:
file: nerdfonts.yml
name: __nerdfonts
- name: Append nerdfonts to pkg_archive
- name: Create nerdfonts directories
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"
when:
- ansible_system == 'Linux'
- nerdfonts_install_list|length > 0
loop: "{{ nerdfonts_install_list }}"
loop_control:
loop_var: nf
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ install_prefix }}/{{ nerdfonts_install_path }}/{{ nf }}"
owner: "{{ install_prefix_owner }}"
group: "{{ install_prefix_group }}"
- name: Generate nerdfont configs
when:
- nerdfonts_install_list|length > 0
loop: "{{ nerdfonts_install_list }}"
loop_control:
loop_var: nf
ansible.bulitin.set_fact:
"nerdfont_{{ nf }}":
extract_to: "{{ install_prefix }}/{{ nerdfonts_install_path }}/{{ nf }}"
url: "{{ nerdfonts_base_url }}/{{ __nerdfonts[nf].archive | default(nf) }}.tar.xz"
- name: Create nerdfont install list
when:
- nerdfonts_install_list|length > 0
loop: "{{ nerdfonts_install_list }}"
loop_control:
loop_var: nf
ansible.builtin.set_fact:
pkg_archive: "{{ pkg_archive + ['nerdfonts'] }}"
nerdfonts_archives: "{{ nerdfonts_archives + [] }}"
- name: Append nerdfonts to pkg_cask
when:
@@ -25,4 +55,4 @@
- name: Set nerdfonts_configured
ansible.builtin.set_fact:
nerdfonts_configured: true
__configured: "{{ __configured | combine( { 'nerdfonts': true } ) }}"