---
# This role will install nim into NITTER_USER using choosenim
- name: Download choosenim install script
  ansible.builtin.get_url:
    url: https://nim-lang.org/choosenim/init.sh
    dest: "/home/{{ NITTER_USER }}/init.sh"
    mode: '0755'
    owner: "{{ NITTER_USER }}"
    group: "{{ NITTER_USER }}"
  become: true
  become_user: "{{ NITTER_USER }}"
- name: Run choosenim install script
  ansible.builtin.shell: "/home/{{ NITTER_USER }}/init.sh -y"
  become: true
  become_user: "{{ NITTER_USER }}"
- name: Copy .bashrc file to add nimble to PATH
  ansible.builtin.template:
    src: .bashrc
    dest: "/home/{{ NITTER_USER }}/.bashrc"
  become: true
  become_user: "{{ NITTER_USER }}"