mirror of
https://codeberg.org/ProgramSnail/config.git
synced 2026-01-01 20:28:16 +00:00
separate install and dev roles, box basic playbook
This commit is contained in:
parent
58966f9e4a
commit
f7a6f59fc6
9 changed files with 44 additions and 14 deletions
9
roles/dev/tasks/build.yml
Normal file
9
roles/dev/tasks/build.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
- name: Install common packages
|
||||
ansible.builtin.dnf5:
|
||||
name:
|
||||
- openssl
|
||||
- perl
|
||||
- ninja-build
|
||||
- git
|
||||
state: latest
|
||||
|
||||
20
roles/dev/tasks/cpp.yml
Normal file
20
roles/dev/tasks/cpp.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
- ansible.builtin.import_tasks: build.yml
|
||||
|
||||
- name: Install tools for cpp dev
|
||||
ansible.builtin.dnf5:
|
||||
name:
|
||||
- make
|
||||
- cmake
|
||||
- xmake
|
||||
|
||||
- clang
|
||||
- clang-tools
|
||||
- clang-tools-extra
|
||||
- clang-devel
|
||||
- clang-tools-devel
|
||||
- clang-tools-extra-devel
|
||||
- clang-libs
|
||||
|
||||
- doxygen
|
||||
|
||||
state: latest
|
||||
19
roles/dev/tasks/haskell.yml
Normal file
19
roles/dev/tasks/haskell.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
- name: Download ghcup bootstrap script
|
||||
ansible.builtin.uri:
|
||||
url:
|
||||
return_content: yes
|
||||
register: ghcup_bootstrap
|
||||
|
||||
- name: Install ghcup, stack, lsp server
|
||||
ansible.builtin.shell:
|
||||
cmd: sh
|
||||
stdin: {{ ghcup_bootstrap.content }}
|
||||
environment:
|
||||
SHELL: /usr/bin/fish # TODO: detect fish install ??
|
||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
||||
BOOTSTRAP_HASKELL_GHC_VERSION: latest
|
||||
BOOTSTRAP_HASKELL_CABAL_VERSION: latest
|
||||
BOOTSTRAP_HASKELL_INSTALL_STACK: 1
|
||||
BOOTSTRAP_HASKELL_INSTALL_HLS: 1
|
||||
BOOTSTRAP_HASKELL_ADJUST_BASHRC: P
|
||||
|
||||
25
roles/dev/tasks/js.yml
Normal file
25
roles/dev/tasks/js.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
- name: Install nodejs
|
||||
ansible.builtin.dnf5:
|
||||
name:
|
||||
- nodejs
|
||||
- curl
|
||||
state: latest
|
||||
|
||||
- name: Curl is required for bun
|
||||
ansible.builtin.dnf5:
|
||||
name:
|
||||
- curl
|
||||
state: latest
|
||||
|
||||
- name: Install bun
|
||||
ansible.builtin.shell:
|
||||
cmd: npm install -g bun
|
||||
|
||||
- name: Get programs list to check fish presence
|
||||
ansible.builtin.package_facts:
|
||||
manager: auto
|
||||
|
||||
- name: Update fish path
|
||||
ansible.builtin.shell:
|
||||
cmd: echo 'fish_add_path {{ ansible_env.HOME }}/.bun/bin'
|
||||
when: "'fish' in ansible_facts.packages"
|
||||
18
roles/dev/tasks/main.yml
Normal file
18
roles/dev/tasks/main.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
- ansible.builtin.import_tasks: build.yml
|
||||
|
||||
- ansible.builtin.import_tasks: cpp.yml
|
||||
when: "'cpp' in tools"
|
||||
|
||||
- ansible.builtin.import_tasks: js.yml
|
||||
when: "'js' in tools"
|
||||
|
||||
- ansible.builtin.import_tasks: haskell.yml
|
||||
when: "'haskell' in tools"
|
||||
|
||||
- ansible.builtin.import_tasks: txt.yml
|
||||
when: "'txt' in tools"
|
||||
|
||||
- ansible.builtin.import_tasks: lang.yml
|
||||
when: "'lang' in tools"
|
||||
|
||||
# TODO: ocaml, truffle, ...
|
||||
64
roles/dev/tasks/txt.yml
Normal file
64
roles/dev/tasks/txt.yml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
- name: Get latest typst version
|
||||
community.general.github_release:
|
||||
user: typst
|
||||
repo: typst
|
||||
action: latest_release
|
||||
register: typst_version
|
||||
|
||||
- name: "Installing typst {{ typst_version.tag }}"
|
||||
become: true
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: yes
|
||||
# TODO: insert v before version ??
|
||||
src: "https://github.com/typst/typst/releases/download/{{ typst_version.tag }}/typst-x86_64-unknown-linux-musl.tar.xz"
|
||||
dest: "/usr/bin/"
|
||||
keep_newer: yes
|
||||
mode: a+x
|
||||
extra_opts:
|
||||
- --strip=1
|
||||
- --no-anchored
|
||||
- typst
|
||||
|
||||
- name: Get latest tinymist (typst lsp) version
|
||||
community.general.github_release:
|
||||
user: Myriad-Dreamin
|
||||
repo: tinymist
|
||||
action: latest_release
|
||||
register: tinymist_version
|
||||
|
||||
- name: "Installing tinymist (typst lsp) {{ tinymist_version.tag }}"
|
||||
become: true
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: yes
|
||||
# TODO: insert v before version ??, rc ??
|
||||
src: "https://github.com/Myriad-Dreamin/tinymist/releases/download/{{ tinymist_version.tag }}/tinymist-x86_64-unknown-linux-gnu.tar.gz"
|
||||
dest: "/usr/bin/"
|
||||
mode: a+x
|
||||
keep_newer: yes
|
||||
extra_opts:
|
||||
- --strip=1
|
||||
- --no-anchored
|
||||
- tinymist
|
||||
|
||||
- name: Get latest codebook (spellcheck lsp) version
|
||||
community.general.github_release:
|
||||
user: blopker
|
||||
repo: codebook
|
||||
action: latest_release
|
||||
register: codebook_version
|
||||
|
||||
- name: "Installing codebook (spellcheck lsp) {{ codebook_version.tag }}"
|
||||
become: true
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: yes
|
||||
# TODO: insert v before version ??
|
||||
src: "https://github.com/blopker/codebook/releases/download/{{ codebook_version.tag }}/codebook-lsp-x86_64-unknown-linux-musl.tar.gz"
|
||||
dest: "/usr/bin/"
|
||||
mode: a+x
|
||||
keep_newer: yes
|
||||
extra_opts:
|
||||
- --strip=1
|
||||
- --no-anchored
|
||||
- codebook-lsp
|
||||
|
||||
# TODO: codebook setup (add to helix config, etc.)
|
||||
Loading…
Add table
Add a link
Reference in a new issue