Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ansible/playbooks/setup-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@
ansible.builtin.import_tasks: tasks/deno.yml
when: deno | default(false) | bool
tags: [deno, install]

- name: Import Zed installation tasks
ansible.builtin.import_tasks: tasks/zed.yml
when: zed | default(false) | bool
tags: [zed, install]
83 changes: 83 additions & 0 deletions .ansible/playbooks/tasks/zed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
- name: Check if Zed is already installed
ansible.builtin.stat:
path: "{{ ansible_env.HOME }}/.local/bin/zed"
register: zed_bin

- name: Create temporary directory for Zed download
ansible.builtin.tempfile:
state: directory
suffix: zed
register: zed_temp
when: not zed_bin.stat.exists

- name: Set facts for Zed installation
ansible.builtin.set_fact:
zed_channel: stable
zed_version: latest
zed_arch: >-
{%- if ansible_architecture in ['aarch64', 'arm64'] -%}aarch64{%- else -%}x86_64{%- endif -%}

- name: Download Zed tarball
ansible.builtin.get_url:
url: "https://cloud.zed.dev/releases/{{ zed_channel }}/{{ zed_version }}/download?asset=zed&arch={{ zed_arch }}&os=linux&source=install.sh"

Check failure on line 23 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

yaml[line-length]

Line too long (143 > 120 characters)

Check warning on line 23 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

23:121 [line-length] line too long (143 > 120 characters)

Check failure on line 23 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

yaml[line-length]

Line too long (143 > 120 characters)

Check warning on line 23 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

23:121 [line-length] line too long (143 > 120 characters)
dest: "{{ zed_temp.path }}/zed-linux-{{ zed_arch }}.tar.gz"
mode: '0644'
when: not zed_bin.stat.exists

- name: Prepare Zed application directory
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.local/zed.app"
state: directory
mode: '0755'
when: not zed_bin.stat.exists

- name: Unpack Zed
ansible.builtin.unarchive:
src: "{{ zed_temp.path }}/zed-linux-{{ zed_arch }}.tar.gz"
dest: "{{ ansible_env.HOME }}/.local/"
remote_src: true
when: not zed_bin.stat.exists

- name: Ensure ~/.local/bin and applications directories exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ ansible_env.HOME }}/.local/bin"
- "{{ ansible_env.HOME }}/.local/share/applications"

- name: Link Zed binary
ansible.builtin.file:
src: "{{ ansible_env.HOME }}/.local/zed.app/bin/zed"
dest: "{{ ansible_env.HOME }}/.local/bin/zed"
state: link

- name: Install Zed desktop entry

Check failure on line 57 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.

Check failure on line 57 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.
ansible.builtin.copy:
src: "{{ ansible_env.HOME }}/.local/zed.app/share/applications/dev.zed.Zed.desktop"
dest: "{{ ansible_env.HOME }}/.local/share/applications/dev.zed.Zed.desktop"
remote_src: true
mode: '0644'
ignore_errors: true

- name: Update icon path in desktop file

Check failure on line 65 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.

Check failure on line 65 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.
ansible.builtin.replace:
path: "{{ ansible_env.HOME }}/.local/share/applications/dev.zed.Zed.desktop"
regexp: '^Icon=zed$'
replace: 'Icon={{ ansible_env.HOME }}/.local/zed.app/share/icons/hicolor/512x512/apps/zed.png'
ignore_errors: true

- name: Update Exec path in desktop file

Check failure on line 72 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.

Check failure on line 72 in .ansible/playbooks/tasks/zed.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.
ansible.builtin.replace:
path: "{{ ansible_env.HOME }}/.local/share/applications/dev.zed.Zed.desktop"
regexp: '^Exec=zed$'
replace: 'Exec={{ ansible_env.HOME }}/.local/zed.app/bin/zed'
ignore_errors: true

- name: Cleanup temporary directory
ansible.builtin.file:
path: "{{ zed_temp.path }}"
state: absent
when: zed_temp is defined and zed_temp.path is defined
2 changes: 2 additions & 0 deletions .ansible/variables-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
- pandoc # Universal markup converter (jgm/pandoc)
- pearld # Pearl Full node (pearl-research-labs/pearl)
- prlctl # Pearl Control utility (pearl-research-labs/pearl)
- reth # Modular, contributor-friendly, and blazing-fast implementation of the Ethereum protocol (paradigmxyz/reth)

Check failure on line 174 in .ansible/variables-example.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

yaml[line-length]

Line too long (125 > 120 characters)

Check warning on line 174 in .ansible/variables-example.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

174:121 [line-length] line too long (125 > 120 characters)

Check failure on line 174 in .ansible/variables-example.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

yaml[line-length]

Line too long (125 > 120 characters)

Check warning on line 174 in .ansible/variables-example.yml

View workflow job for this annotation

GitHub Actions / check / Pre-commit

174:121 [line-length] line too long (125 > 120 characters)
- rg # ripgrep recursively searches directories for a regex pattern (BurntSushi/ripgrep)
- rga # ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc. (phiresky/ripgrep-all)
- tealdeer # A fast tldr client written in Rust (dbrgn/tealdeer)
Expand All @@ -184,3 +184,5 @@
nvidia:
cuda_toolkit: true
cuda_toolkit_package: cuda-toolkit-13-1

zed: true
Loading