diff --git a/tasks/config/ghostty.yml b/tasks/config/ghostty.yml index e4b0da0..4d14062 100644 --- a/tasks/config/ghostty.yml +++ b/tasks/config/ghostty.yml @@ -6,6 +6,8 @@ method: "{{ pkgconfig.ghostty.methods[ansible_distribution] | default(pkgconfig.ghostty.methods.default) }}" - name: Set ghostty config + when: + - ghostty.method == 'src' ansible.builtin.set_fact: ghostty: method: "{{ ghostty.method }}" @@ -17,6 +19,16 @@ build_deps: "{{ pkgconfig.ghostty.build_deps[ansible_os_family] }}" optimize: "{{ pkgconfig.ghostty.optimize }}" +- name: Set ghostty package manager install + when: + - ghostty.method == 'sys' or + ghostty.method == 'cask' + ansible.builtin.set_fact: + ghostty: + method: "{{ ghostty.method }}" + pkg: "{{ pkconfig.ghostty[ghostty.method] }}" + pkg_repo: "{{ pkgconfig.ghostty.pkg_repo[ansible_distribution] | default(omit) }}" + - name: Set ghostty config for appimage install when: - ghostty.method == 'appimage' diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index da04778..e7dbc7e 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -8,45 +8,46 @@ ansible.builtin.include_tasks: file: config/ghostty.yml - - name: Source ghostty pkg installation + - name: Append ghostty to pkg_src when: - ghostty.method == 'src' - - ansible_distribution != 'MacOSX' - block: - - name: Append ghostty build deps to pkg_sys - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ghostty.build_deps }}" - - - name: Append ghostty to pkg_src - notify: - - Depend zig - changed_when: true - ansible.builtin.set_fact: - pkg_src: "{{ pkg_src + ghostty.pkg }}" + notify: + - Depend zig + changed_when: true + ansible.builtin.set_fact: + pkg_src: "{{ pkg_src + ghostty.pkg }}" + pkg_sys: "{{ pkg_sys + ghostty.build_deps }}" - name: Append ghostty to pkg_appimage when: - ghostty.method == 'appimage' - - ansible_distribution != 'MacOSX' ansible.builtin.set_fact: pkg_appimage: "{{ pkg_appimage + ghostty }}" - - name: Sys pkg installation + - name: Install ghostty via package manager when: - ghostty.method == 'sys' block: - - name: Append ghostty to pkg_sys + - name: Enable repo for ghostty when: - ansible_distribution == 'Fedora' - notify: - - Depend terra repo changed_when: true + ansible.builtin.get_url: + mode: '0644' + decompress: false + backup: false + url: "{{ ghostty.pkg_repo.url }}" + dest: "{{ ghostty.pkg_repo.dest }}" + + - name: Append ghostty to pkg_sys + when: + - ansible_distriubtion ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ghostty.pkg }}" - name: Append ghostty to pkg_cask when: - - ghostty.method == 'brew' + - ghostty.method == 'cask' ansible.builtin.set_fact: pkg_cask: "{{ pkg_cask + ghostty.pkg }}" diff --git a/vars/pkgs/ghostty.yml b/vars/pkgs/ghostty.yml index 5492c10..66eb21a 100644 --- a/vars/pkgs/ghostty.yml +++ b/vars/pkgs/ghostty.yml @@ -32,7 +32,10 @@ ghostty: - ghostty src: - ghostty + pkg_repo: + Fedora: + url: https://terra.fyralabs.com/terra.repo + dest: /etc/yum.repos.d/terra.repo methods: default: src - Fedora: sys MacOSX: cask