machine_setup/ansible/roles/rust/tasks/peruser_linux.yaml

53 lines
1.9 KiB
YAML
Raw Normal View History

2022-10-20 04:57:05 +00:00
- name: Set nightly as the default toolchain
command: "rustup default nightly-{{ rust_date }}"
args:
creates: "{{ account_homedir.stdout }}/.rustup/toolchains/nightly-{{ rust_date }}-x86_64-unknown-linux-gnu"
2023-12-24 05:56:25 +00:00
- name: Install targets
command: rustup target add "{{ item }}"
2022-10-20 04:57:05 +00:00
args:
2023-12-24 05:56:25 +00:00
creates: "{{ account_homedir.stdout }}/.rustup/toolchains/nightly-{{ rust_date }}-x86_64-unknown-linux-gnu/lib/rustlib/{{ item }}"
loop:
- x86_64-unknown-linux-musl
- wasm32-unknown-unknown
2022-10-20 04:57:05 +00:00
# Needed by rust-analyzer (rust-analyzer will attempt to install via rustup on its own, but this will install it manually).
- name: Install the nightly rust-src
command: rustup component add rust-src
args:
creates: "{{ account_homedir.stdout }}/.rustup/toolchains/nightly-{{ rust_date }}-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rust-src"
2023-10-16 23:46:29 +00:00
- name: Install clippy
command: rustup component add clippy
args:
creates: "{{ account_homedir.stdout }}/.rustup/toolchains/nightly-{{ rust_date }}-x86_64-unknown-linux-gnu/bin/cargo-clippy"
2024-02-11 19:59:55 +00:00
- name: Install cranelift
command: rustup component add rustc-codegen-cranelift
args:
creates: "{{ account_homedir.stdout }}/.rustup/toolchains/nightly-{{ rust_date }}-x86_64-unknown-linux-gnu/lib/rustlib/manifest-rustc-codegen-cranelift-preview-x86_64-unknown-linux-gnu"
2022-10-20 04:57:05 +00:00
- name: Create directories
file:
name: "{{ account_homedir.stdout }}/{{ item }}"
state: directory
mode: 0755
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- .cargo
- name: Copy files
no_log: true
copy:
src: "files/{{ item.src }}"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- src: cargo_credentials.toml
dest: .cargo/credentials
- src: cargo_config.toml
dest: .cargo/config