From 19b706da4cf51a1c4e3d0bc0792aac8311adf098 Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Fri, 8 Aug 2025 14:41:44 +0300 Subject: [PATCH] spellcheck lsp, diff with code syntax understanding, trash cli, files autodelete in 30 days setup --- roles/dotfiles/tasks/cli.yml | 17 +---------------- roles/dotfiles/tasks/scripts.yml | 9 ++++++++- roles/installs/tasks/cli.yml | 12 ++++++++++-- roles/writing/tasks/main.yml | 23 +++++++++++++++++++++++ 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/roles/dotfiles/tasks/cli.yml b/roles/dotfiles/tasks/cli.yml index 258f356..8cd4f79 100644 --- a/roles/dotfiles/tasks/cli.yml +++ b/roles/dotfiles/tasks/cli.yml @@ -18,7 +18,7 @@ state: link force: true -# TODO: set server keys +# TODO: set server keys in some way - name: Link tmate configuration ansible.builtin.file: src: '{{ role_path }}/files/.tmate.conf' @@ -33,21 +33,6 @@ state: link force: true -# additional files -- name: Link scripts - ansible.builtin.file: - src: '{{ role_path }}/files/.bin' - dest: '{{ ansible_env.HOME }}/.bin' - state: link - force: true - -- name: Link templates - ansible.builtin.file: - src: '{{ role_path }}/files/.templates' - dest: '{{ ansible_env.HOME }}/.templates' - state: link - force: true - # path update - name: Get programs list to check fish presence ansible.builtin.package_facts: diff --git a/roles/dotfiles/tasks/scripts.yml b/roles/dotfiles/tasks/scripts.yml index 4fe66ec..5f14598 100644 --- a/roles/dotfiles/tasks/scripts.yml +++ b/roles/dotfiles/tasks/scripts.yml @@ -1,6 +1,13 @@ -- name: Link scripts directory +- name: Link scripts ansible.builtin.file: src: '{{ role_path }}/files/.bin' dest: '{{ ansible_env.HOME }}/.bin' state: link force: true + +- name: Link templates + ansible.builtin.file: + src: '{{ role_path }}/files/.templates' + dest: '{{ ansible_env.HOME }}/.templates' + state: link + force: true diff --git a/roles/installs/tasks/cli.yml b/roles/installs/tasks/cli.yml index 3c09574..8c9724d 100644 --- a/roles/installs/tasks/cli.yml +++ b/roles/installs/tasks/cli.yml @@ -1,9 +1,11 @@ - name: Install cli tools ansible.builtin.dnf5: name: - # shell utils - - just + # shells & shell utils + - bash - fish + - trash-cli + - just - jsonnet # edit utils @@ -15,9 +17,15 @@ # git - git-delta + - difftastic - git + # other - ansible state: latest +- name: Clear trash automatically every 30 days + ansible.builtin.shell: + cmd: sh + stdin: '(crontab -l ; echo "@daily $(which trash-empty) 30")' diff --git a/roles/writing/tasks/main.yml b/roles/writing/tasks/main.yml index caad1be..cbcdde5 100644 --- a/roles/writing/tasks/main.yml +++ b/roles/writing/tasks/main.yml @@ -39,3 +39,26 @@ - --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.)