working on nerdfonts still
This commit is contained in:
@@ -2,20 +2,33 @@
|
||||
---
|
||||
- name: Set package_home_base for Darwin
|
||||
when:
|
||||
- ansible_system == 'Darwin'
|
||||
- ansible_facts["system"] == 'Darwin'
|
||||
ansible.builtin.set_fact:
|
||||
package_home_base: /Users
|
||||
|
||||
- name: Set package_home_base for Linux
|
||||
when:
|
||||
- ansible_system == 'Linux' or
|
||||
ansible_os_family == 'FreeBSD'
|
||||
- ansible_facts["system"] == 'Linux' or
|
||||
ansible_facts["os_family"] == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
package_home_base: /home
|
||||
|
||||
- name: Set default paths
|
||||
ansible.builtin.set_fact:
|
||||
path_appimage: "{{ install_prefix }}/appimage"
|
||||
path_archive: "{{ install_prefix }}/archive"
|
||||
path_bin: "{{ install_prefix }}/bin"
|
||||
path_cargo: "{{ install_prefix }}/cargo"
|
||||
path_git: "{{ install_prefix }}/git"
|
||||
path_go: "{{ install_prefix }}/go"
|
||||
path_pipx: "{{ install_prefix }}/pipx"
|
||||
store_path: "{{ ansible_facts['user_dir'] }}/.cache/ansible_role_package"
|
||||
path_lib: "{{ install_prefix }}/lib"
|
||||
|
||||
|
||||
- name: Set Linux specific facts
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
ansible.builtin.set_fact:
|
||||
pipx_exec: "/usr/bin/pipx"
|
||||
path_lib: lib64
|
||||
@@ -23,13 +36,13 @@
|
||||
|
||||
- name: Set alpine linux specific facts
|
||||
when:
|
||||
- ansible_os_family == 'Alpine'
|
||||
- ansible_facts["os_family"] == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
path_lib: lib
|
||||
|
||||
- name: Set dist code if RedHat based
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_facts["os_family"] == 'RedHat'
|
||||
changed_when: false
|
||||
register: rpm_dist
|
||||
ansible.builtin.command:
|
||||
@@ -37,8 +50,8 @@
|
||||
|
||||
- name: Set macOS specific facts
|
||||
when:
|
||||
- ansible_distribution == 'MacOSX' or
|
||||
ansible_distribution == 'MacOS'
|
||||
- ansible_facts["distribution"] == 'MacOSX' or
|
||||
ansible_facts["distribution"] == 'MacOS'
|
||||
ansible.builtin.set_fact:
|
||||
brewtap: [] # homebrew taps to add
|
||||
pipx_exec: "/opt/homebrew/bin/pipx" # pipx executable
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
- archive.name is defined
|
||||
- archive.url is defined
|
||||
block:
|
||||
- name: Dump archive vars
|
||||
ansible.builtin.debug:
|
||||
var: archive
|
||||
- name: Extract archive to given path
|
||||
block:
|
||||
- name: Ensure directory exists
|
||||
@@ -15,8 +18,8 @@
|
||||
state: directory
|
||||
path: "{{ archive.extract_to }}"
|
||||
mode: "{{ archive.mode | default('0755') }}"
|
||||
owner: "{{ archive.owner | default(ansible_user_id)}}"
|
||||
group: "{{ archive.group | default(ansible_user_gid) }}"
|
||||
owner: "{{ archive.owner | default(ansible_facts['user_id']) }}"
|
||||
group: "{{ archive.group | default(ansible_facts['user_gid']) }}"
|
||||
|
||||
- name: Download archive to cache
|
||||
ansible.builtin.get_url:
|
||||
|
||||
27
tasks/helpers/nerdfont_config.yml
Normal file
27
tasks/helpers/nerdfont_config.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Load nerdfonts list
|
||||
ansible.builtin.include_vars:
|
||||
file: nerdfonts.yml
|
||||
name: __nerdfonts
|
||||
|
||||
- name: Generate nerdfont configs
|
||||
when:
|
||||
- __nerdfonts[nf] is defined
|
||||
ansible.builtin.set_fact:
|
||||
__font_config:
|
||||
extract_to: "{{ path_archive }}/nerdfonts/{{ nf }}"
|
||||
url: "{{ nerdfonts_base_url }}/{{ __nerdfonts[nf]['archive'] | default(nf) }}.tar.xz"
|
||||
name: "{{ __nerdfonts[nf]['archive'] | default(nf) }}.tar.xz"
|
||||
links:
|
||||
- from: "{{ path_archive }}/nerdfonts/{{ nf }}"
|
||||
to: "{{ install_prefix }}/{{ nerdfonts_install_path }}/{{ nf }}"
|
||||
force: true
|
||||
|
||||
- name: Dump current nerdfont config
|
||||
ansible.builtin.debug:
|
||||
var: __font_config
|
||||
|
||||
- name: Append config to pkg archive
|
||||
ansible.builtin.set_fact:
|
||||
pkg_archive: "{{ pkg_archive + [__font_config] }}"
|
||||
@@ -13,8 +13,8 @@
|
||||
ansible.builtin.file:
|
||||
path: "{{ store_path }}"
|
||||
mode: '0755'
|
||||
owner: "{{ ansible_user_id }}"
|
||||
group: "{{ ansible_user_gid }}"
|
||||
owner: "{{ ansible_facts['user_id'] }}"
|
||||
group: "{{ ansible_facts['user_gid'] }}"
|
||||
state: directory
|
||||
|
||||
- name: Ensure required paths exists
|
||||
@@ -40,16 +40,21 @@
|
||||
- name: Read package configuration
|
||||
ansible.builtin.include_vars:
|
||||
file: pkglist.yml
|
||||
|
||||
- name: Load nerdfonts list
|
||||
ansible.builtin.include_vars:
|
||||
file: nerdfonts.yml
|
||||
name: __nerdfonts
|
||||
|
||||
- name: Add needed packages for Fedora
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_facts["distribution"] == 'Fedora'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ packages_extra + ['python3-paramiko'] }}"
|
||||
|
||||
- name: Add needed MacOS packages
|
||||
when:
|
||||
- ansible_distribution == 'MacOSX'
|
||||
- ansible_facts["distribution"] == 'MacOSX'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ packages_extra + ['gnu-tar', 'virtualenv'] }}"
|
||||
|
||||
@@ -159,13 +164,13 @@
|
||||
|
||||
- name: Linux specific tasks
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
ansible.builtin.include_tasks:
|
||||
file: linux.yml
|
||||
|
||||
- name: MacOS specific tasks
|
||||
when:
|
||||
- ansible_distribution == 'MacOSX'
|
||||
- ansible_facts["distribution"] == 'MacOSX'
|
||||
ansible.builtin.include_tasks:
|
||||
file: macos.yml
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
---
|
||||
- name: Add nerdfonts
|
||||
when:
|
||||
- "'nerdfonts' in __configured"
|
||||
- "'nerdfonts' not in __configured"
|
||||
block:
|
||||
- name: Load nerdfonts list
|
||||
ansible.builtin.include_vars:
|
||||
@@ -12,46 +12,30 @@
|
||||
- name: Create nerdfonts directories
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
when:
|
||||
- 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 }}"
|
||||
path: "{{ install_prefix }}/{{ nerdfonts_install_path }}"
|
||||
owner: "{{ install_prefix_owner }}"
|
||||
group: "{{ install_prefix_group }}"
|
||||
|
||||
- name: Generate nerdfont configs
|
||||
- name: Configure nerdfonts archive install
|
||||
when:
|
||||
- nerdfonts_install_list|length > 0
|
||||
- ansible_facts["system"] != 'Darwin'
|
||||
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:
|
||||
nerdfonts_archives: "{{ nerdfonts_archives + [] }}"
|
||||
ansible.builtin.include_tasks: helpers/nerdfont_config.yml
|
||||
|
||||
- name: Append nerdfonts to pkg_cask
|
||||
when:
|
||||
- ansible_system == 'Darwin'
|
||||
loop: "{{ nerdfonts.fonts }}"
|
||||
- ansible_facts["system"] == 'Darwin'
|
||||
loop: "{{ nerdfonts_install_list }}"
|
||||
loop_control:
|
||||
loop_var: font
|
||||
loop_var: nf
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + [pkgconfig.nerdfonts.fonts[font].brew] }}"
|
||||
pkg_cask: "{{ pkg_cask + [__nerdfonts[nf].brew] }}"
|
||||
|
||||
- name: Set nerdfonts_configured
|
||||
ansible.builtin.set_fact:
|
||||
|
||||
@@ -23,19 +23,6 @@ flatpak_default_remote: flathub
|
||||
flatpak_method: system
|
||||
flatpak_remotes: "{{ [flathub_remote] }}"
|
||||
|
||||
# Installation paths
|
||||
path_appimage: "{{ install_prefix }}/appimage"
|
||||
path_archive: "{{ install_prefix }}/archive"
|
||||
path_bin: "{{ install_prefix }}/bin"
|
||||
path_cargo: "{{ install_prefix }}/cargo"
|
||||
path_git: "{{ store_path }}/git"
|
||||
path_go: "{{ install_prefix }}/go"
|
||||
path_pipx: "{{ install_prefix }}/pipx"
|
||||
store_path: "{{ ansible_user_dir }}/.cache/ansible_role_package"
|
||||
path_lib: "{{ install_prefix }}/lib"
|
||||
|
||||
# System paths
|
||||
|
||||
# empty lists that must be defined
|
||||
pkg_appimage: [] # appimages to install
|
||||
pkg_archive: [] # packages installed via prebuilt archive
|
||||
@@ -129,41 +116,9 @@ ansible_ls_version: latest
|
||||
ansible_ls_pkg_deps:
|
||||
- pkgs/npm.yml
|
||||
# }}}
|
||||
# go {{{
|
||||
go_archive_version: 1.25.6
|
||||
go_archive_archmap:
|
||||
arm64: arm64
|
||||
aarch64: arm64
|
||||
x86_64: amd64
|
||||
go_archive_url_base: https://go.dev/dl
|
||||
go_archive_sums:
|
||||
1.25.6:
|
||||
Darwin:
|
||||
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
|
||||
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
|
||||
Linux:
|
||||
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
|
||||
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
|
||||
FreeBSD:
|
||||
amd64: sha256:61e1d50e332359474ff6dcf4bc0bd34ba2d2cf4ef649593a5faa527f0ab84e2b
|
||||
arm64: sha256:648484146702dd58db0e2c3d15bda3560340d149ed574936e63285a823116b77
|
||||
go_profile_path:
|
||||
Linux: /etc/profile.d
|
||||
FreeBSD: /etc/profile.d
|
||||
go_pkgname:
|
||||
RedHat: go
|
||||
Debian: go
|
||||
Darwin: go
|
||||
FreeBSD:
|
||||
default: go
|
||||
1.25: go125
|
||||
1.24: go124
|
||||
1.23: go123
|
||||
1.22: go122
|
||||
# }}}
|
||||
# {{{ nerdfonts
|
||||
nerdfonts_install_list:
|
||||
JetBrainsMono
|
||||
- JetBrainsMono
|
||||
- FiraCode
|
||||
- FiraMono
|
||||
- GoMono
|
||||
@@ -171,5 +126,4 @@ nerdfonts_install_list:
|
||||
- Symbols
|
||||
nerdfonts_base_url: https://github.com/ryanoasis/nerd-fonts/releases/latest/download
|
||||
nerdfonts_install_path: share/fonts
|
||||
nerdfonts_archives: []
|
||||
# }}}
|
||||
|
||||
Reference in New Issue
Block a user