# Load distro-specific variables
- include_vars: "{{ ansible_distribution }}.yml"
  tags: always

- block:
  ## User configs
  - ansible.builtin.import_tasks: users/super_user.yml

## desktop environments

  - ansible.builtin.include_tasks: desktop_environments/gnome/appearance.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/keybindings.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/nautilus.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/packages.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/peripherals.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/shell_settings.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/terminal.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/gnome/tracker.yml
    when: gnome is defined and gnome == true

  - ansible.builtin.include_tasks: desktop_environments/xfce/config.yml
    when: xfce is defined and xfce == true
    
  ## system setup
  #- ansible.builtin.import_tasks: system_setup/autofs.yml
  - ansible.builtin.import_tasks: system_setup/scripts.yml
  - ansible.builtin.import_tasks: system_setup/tweaks.yml

  ## install software
  - ansible.builtin.import_tasks: software/brave.yml
  - ansible.builtin.import_tasks: software/google_chrome.yml
  - ansible.builtin.import_tasks: software/codecs.yml
  - ansible.builtin.import_tasks: software/firefox.yml
  - ansible.builtin.import_tasks: software/google_chrome.yml
  - ansible.builtin.import_tasks: software/libreoffice.yml
  - ansible.builtin.import_tasks: software/lutris.yml
  - ansible.builtin.import_tasks: software/misc_packages.yml
  - ansible.builtin.import_tasks: software/nextcloud.yml
  - ansible.builtin.import_tasks: software/solaar.yml
  - ansible.builtin.import_tasks: software/steam.yml
  - ansible.builtin.import_tasks: software/thunderbird.yml
  - ansible.builtin.import_tasks: software/vlc.yml
  - ansible.builtin.import_tasks: software/vscodium.yml
  - ansible.builtin.import_tasks: software/sublime_text.yml
  - ansible.builtin.import_tasks: software/kube_lens.yml

  rescue:
    - set_fact: task_failed=true
