# Some basics tools that are required to be installed to run others parts of the playbook # Note: this first task is only useful when running this playbook without lxup obviously... - name: Install lxup via curl tags: base shell: cmd: | mkdir -p ~/.config/fish/functions/ # create folder if it doesn't exist curl https://codeberg.org/samuelroland/productivity/raw/branch/main/HEIG/tools/lxup.fish -o ~/.config/fish/functions/lxup.fish args: creates: ~/.config/fish/functions/lxup.fish - name: Install scr, r via lxup get tags: base # To make sure these are up-to-date # args: # creates: "~/.config/fish/functions/{{ item }}.fish" command: fish -c 'lxup get {{ item }}' loop: - lxup # hacky way to make sure it is up-to-date - scr - r - labget - name: Install all DNF dependencies for Fish functions tags: base when: ansible_facts['os_family'] == "RedHat" become: true ansible.builtin.dnf: name: - fzf - jq - entr - fd-find # Rustup and build tools like gcc and cmake for cargo builds - rustup # the Rust toolings manager, help to have all tools up-to-date, add toolchains, ... - gcc # a C compiler is necessary to build some crates - cmake - pipx # FLATHUB ENABLE - obsolete as no flatpak app is used here... # - name: Check the variant of Fedora # tags: base # when: ansible_facts['os_family'] == "RedHat" # register: fedora_variant # ansible.builtin.shell: # cmd: cat /etc/os-release | grep -oP "VARIANT=\K.*" # - name: Configure flathub as a remote of Flatpak, only if this is a native installation # when: '"WSL" not in fedora_variant.stdout and "Container" not in fedora_variant.stdout and ansible_facts['os_family'] == "RedHat"' # tags: base # community.general.flatpak_remote: # name: flathub # flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo # method: user - name: Install all APT dependencies for Fish functions tags: base become: true when: ansible_facts['os_family'] == "Debian" ansible.builtin.apt: update_cache: true # run apt update before name: - fzf - jq - entr - fd-find # WARNING: the command is fdfind command not fd # Rustup and build tools like gcc and cmake for cargo builds - rustup # the Rust toolings manager, help to have all tools up-to-date, add toolchains, ... - gcc # a C compiler is necessary to build some crates - cmake - pipx # PIPX setup - name: Make sure ~/.local/bin is in PATH or let pipx insert it, manually inclusion with Fish tags: base ansible.builtin.shell: | pipx ensurepath fish -c "fish_add_path --append ~/.local/bin" || true # RUST TOOLCHAIN - name: Check if Rust toolchain is already installed tags: base failed_when: false # never failed even if the exit code is not zero register: rustc_res ansible.builtin.command: rustc -V # https://rust-lang.github.io/rustup/installation/other.html#general-tips - name: Run rustup-init on Fedora to install all useful Rust tools tags: base when: ansible_facts['os_family'] == "RedHat" and rustc_res.rc > 0 ansible.builtin.command: cmd: rustup-init -y creates: "{{ ansible_env.HOME }}/.cargo/bin/rustc" - name: Run rustup default stable to install the latest stable Rust toolchain tags: base when: ansible_facts['os_family'] == "Debian" ansible.builtin.command: cmd: rustup default stable # Note: there is no way to check if this is installed by looking at a file... it is under /usr/bin/rustc with a symlink to rustup # Do not use this line, use the when condition instead # creates: "{{ ansible_env.HOME }}/.cargo/bin/rustc" - name: Add ~/.cargo/bin to PATH in Fish tags: base ansible.builtin.shell: cmd: | # Note: we need to create the folder because it doesn't exist at first on Ubuntu fish -c "mkdir -p ~/.cargo/bin && fish_add_path --append ~/.cargo/bin" || true