---
- name: Upgrade all packages
  package:
    name: "*"
    state: latest

- name: install window manager packages
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ wm_packages }}"

- name: install cli packages
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ general_packages }}"

- name: install doom dependencies
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ doom_dep_packages }}"

- name: install networking packages
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ networking_packages }}"

- name: install UI packages
  package:
    name: "{{ item }}"
    state: present
  loop: "{{ ui_packages }}"

- name: Add Flathub repository
  flatpak_remote:
    name: flathub
    flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
    state: present

- name: Install flatpak packages
  flatpak:
    name: "{{ item }}"
    state: present
    remote: flathub
  loop: "{{ flatpak_packages }}"

- name: Download VeraCrypt deb file
  get_url:
    url: "{{ veracrypt_deb_url }}"
    dest: "/tmp/veracrypt.deb"
    mode: '0644'

- name: Install VeraCrypt using the deb file
  apt:
    deb: "/tmp/veracrypt.deb"
    state: present

- name: Download the translate-shell binary
  get_url:
    url: https://git.io/trans
    dest: /usr/local/bin/trans
    mode: '0755'

- name: Ensure the translate-shell binary is executable
  file:
    path: /usr/local/bin/trans
    mode: '0755'
    state: file
