---
- name: packages | Install Go packages
  tags: go
  environment:
    GOPATH: '{{ xdg_dir.data_home }}/go'
    GOPROXY: direct
  import_tasks: go-packages.yml

- name: packages | Install Rust packages with cargo
  tags: [rust, cargo]
  environment:
    CARGO_HOME: '{{ xdg_dir.data_home }}/cargo'
  import_tasks: rust-packages.yml

# Obviously you need to have NodeJS installed.
# Also require settings in .npmrc (*dotfiles* playbook).
- name: packages | Install Javascript packages with pnpm
  tags: [nodejs, pnpm]
  environment:
    PNPM_HOME: '{{ xdg_dir.data_home }}/pnpm'
  import_tasks: pnpm-packages.yml

- name: packages | Install Haskell packages with cabal
  tags: [cabal, haskell]
  vars:
    cabal_arguments: --overwrite-policy=always --enable-library-stripping --enable-executable-stripping
  import_tasks: haskell-packages.yml

- name: packages | Install Python packages with pip
  tags: [pip, python]
  vars:
    # NOTE: There is `py_info` and `wheel` directories here so avoid them
    python_venv_root: '{{ xdg_dir.data_home }}/virtualenv'
  import_tasks: pip-packages.yml

- name: packages | Install pyenv
  tags: [pyenv, python]
  environment:
    PYENV_ROOT: '{{ xdg_dir.data_home }}/pyenv'
  import_tasks: pyenv.yml

- name: packages | Install system packages
  tags: apk
  become: true
  import_tasks: apk-packages.yml

- name: packages | Install and configure flatpak packages
  tags: flatpak
  import_tasks: flatpak.yml

# https://cloud.google.com/sdk/docs/install
# As much as I hate it, I need gcloud for work :(
- name: packages | Install gcloud, gsutil and bq
  tags: gcloud
  import_tasks: gcloud.yml

- name: packages | Install Helm plugins
  tags: helm-plugins
  command:
    cmd: /usr/bin/helm plugin install {{ item }}
    removes: /usr/bin/helm
  loop:
    - https://github.com/databus23/helm-diff.git
    - https://github.com/helm-unittest/helm-unittest.git
    - https://github.com/helm/helm-mapkubeapis.git
    - https://github.com/hypnoglow/helm-s3.git
    - https://github.com/jkroepke/helm-secrets.git
    - https://github.com/chartmuseum/helm-push.git
