-
Notifications
You must be signed in to change notification settings - Fork 2
/
compile-helix-playbook.yml
59 lines (53 loc) · 2.51 KB
/
compile-helix-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maybe included in Debian 13 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024683
- name: Install Helix
hosts: localhost
vars:
helix_src_folder: "{{ ansible_facts['user_dir'] }}/src/helix"
helix_config_folder: "{{ ansible_facts['user_dir'] }}/.config/helix"
helix_git_version: "9e7c488ee33eaabab6ee7c3436f4c58b8c647b4f"
tasks:
- name: Clone Helix editor from GitHub
ansible.builtin.git:
repo: https://github.com/helix-editor/helix
dest: "{{ helix_src_folder }}"
version: "{{ helix_git_version }}"
clone: true
update: false
register: helix_cloned
- name: Install and setup Helix
when: helix_cloned.changed
block:
- name: Install Helix
ansible.builtin.shell: >
cargo install --locked --path "{{ helix_src_folder }}/helix-term"
- name: Create Helix editor config symlink
ansible.builtin.file:
src: "{{ helix_src_folder }}/runtime"
dest: "{{ helix_config_folder }}/runtime"
state: link
- name: Ensure the icons directory exists
ansible.builtin.file:
path: "{{ ansible_facts['user_dir'] }}/.icons"
state: directory
mode: "0755"
- name: Copy Helix editor icons
ansible.builtin.copy:
src: "{{ helix_src_folder }}/contrib/helix.png"
dest: "{{ ansible_facts['user_dir'] }}/.icons/helix.png"
- name: Create Helix .desktop file
ansible.builtin.copy:
dest: "{{ ansible_facts['user_dir'] }}/.local/share/applications/helix.desktop"
content: |
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec={{ ansible_env.HOME }}/.local/kitty.app/bin/kitty {{ ansible_env.HOME }}/.cargo/bin/hx %F
Name=Helix
Comment=Open in Helix using the Kitty terminal
Icon={{ ansible_env.HOME }}/.icons/helix.png
Categories=Utility;TerminalEmulator;
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;text/html;application/toml;text/x-python;application/json;application/javascript;
- name: Update the desktop database
ansible.builtin.command: update-desktop-database "{{ ansible_facts['user_dir'] }}/.local/share/applications"
changed_when: false