From cad054d468672fb921ee8da67c833f17c65ca231 Mon Sep 17 00:00:00 2001 From: Bartal Laearsson Date: Mon, 29 Jun 2026 14:12:43 +0100 Subject: [PATCH] add java ls --- README.md | 38 +-------------------------------- setup.yml | 1 + tasks/jdtls.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ vars.yml | 5 ++++- 4 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 tasks/jdtls.yml diff --git a/README.md b/README.md index 27f73f3..a82aac3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # Fedora Sway workstation -An Ansible playbook for rebuilding the two NixOS workstation hosts as a native -Fedora Sway desktop. The NixOS server host (`sta-len-nix`) and its services, -WireGuard, firewall, and Netdata configuration are intentionally excluded. - ## Target - Native Fedora 44 on x86_64 @@ -21,30 +17,9 @@ Install Ansible as the normal desktop user: sudo dnf install -y ansible git clone https://codeberg.org/bartal-lsn/fedora-provisioning.git cd fedora-provisioning -ansible-playbook setup.yml --ask-become-pass +ansible-playbook setup.yml -K ``` -Do not start the playbook with `sudo`. It uses privilege escalation only for -system tasks and installs Zen and user configuration into the invoking user's -home directory. Log out or reboot after the first run to enter Sway through -SDDM and pick up the new group memberships and environment. - -## Configuration ownership - -The Home Manager configuration lives in the public -`https://codeberg.org/bartal-lsn/dotfiles` repository as GNU Stow packages. -During provisioning, Ansible clones or updates that repository at -`~/dotfiles`, then runs `stow -R *` from that directory. Stow therefore -restows every package into the user's home directory. - -Commit dotfile changes to the Codeberg repository, then rerun the playbook to -pull `~/dotfiles` and refresh its links. Editor-managed binaries such as `zls`, -`omnisharp`, `jdtls`, and `lua-language-server` remain Neovim concerns because -Fedora does not package them consistently. Ansible installs Fedora's `clangd` -and `gopls`, Pyright, TypeScript language server, Black, isort, Prettier, and -StyLua. Rust and `rust-analyzer` are installed through the official rustup -installer. - ## Desktop keys | Key | Action | @@ -69,17 +44,6 @@ The main switches live near the top of `vars.yml`: - `upgrade_system`: upgrade packages before provisioning - `install_virtualization`: install Fedora's libvirt virtualization group - `install_sqlcmd`: retain the Fedora repository's existing SQL Server CLI -- `install_typora`: install the unverified Flathub Typora wrapper - -The playbook installs OpenJDK 25 because Fedora 44 does not publish the -OpenJDK 21 RPM used by the NixOS setup. - -Fedora does not have a direct equivalent for NixOS's -`virtualisation.vmware.host.enable`; this playbook uses Fedora's supported -libvirt stack instead. Typora is optional because its Flathub wrapper is not -verified by Typora. Zen never uses Flatpak: Ansible downloads the official -release archive directly, places it under `~/.tarball-installations/zen`, and -creates the `~/.local/bin/zen` launcher. ## Re-running diff --git a/setup.yml b/setup.yml index 439eda3..c00e51c 100644 --- a/setup.yml +++ b/setup.yml @@ -27,6 +27,7 @@ - ansible.builtin.import_tasks: tasks/system.yml - ansible.builtin.import_tasks: tasks/services.yml - ansible.builtin.import_tasks: tasks/tooling.yml + - ansible.builtin.import_tasks: tasks/jdtls.yml - ansible.builtin.import_tasks: tasks/sqlcmd.yml when: install_sqlcmd - ansible.builtin.import_tasks: tasks/zen.yml diff --git a/tasks/jdtls.yml b/tasks/jdtls.yml new file mode 100644 index 0000000..761792c --- /dev/null +++ b/tasks/jdtls.yml @@ -0,0 +1,57 @@ +--- +- name: Check for Eclipse JDT Language Server + ansible.builtin.stat: + path: "{{ jdtls_install_dir }}/bin/jdtls" + become: false + register: jdtls_binary + +- name: Create JDT LS installation directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ user_name }}" + mode: "0755" + become: false + loop: + - "{{ jdtls_install_dir }}" + - "{{ user_home }}/.local/bin" + +- name: Read the JDT LS milestone archive name + ansible.builtin.uri: + url: "{{ jdtls_base_url }}/latest.txt" + return_content: true + become: false + register: jdtls_latest + when: not jdtls_binary.stat.exists + +- name: Download Eclipse JDT Language Server + ansible.builtin.get_url: + url: "{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}" + dest: "{{ jdtls_archive }}" + mode: "0644" + checksum: "sha256:{{ jdtls_base_url }}/{{ jdtls_latest.content | trim }}.sha256" + become: false + when: not jdtls_binary.stat.exists + +- name: Extract Eclipse JDT Language Server + ansible.builtin.unarchive: + src: "{{ jdtls_archive }}" + dest: "{{ jdtls_install_dir }}" + remote_src: true + creates: "{{ jdtls_install_dir }}/bin/jdtls" + become: false + when: not jdtls_binary.stat.exists + +- name: Link jdtls into the user's PATH + ansible.builtin.file: + src: "{{ jdtls_install_dir }}/bin/jdtls" + dest: "{{ user_home }}/.local/bin/jdtls" + state: link + force: true + become: false + +- name: Remove downloaded JDT LS archive + ansible.builtin.file: + path: "{{ jdtls_archive }}" + state: absent + become: false diff --git a/vars.yml b/vars.yml index 6754b39..94441b2 100644 --- a/vars.yml +++ b/vars.yml @@ -4,6 +4,10 @@ user_home: "{{ lookup('env', 'HOME') }}" dotfiles_dir: "{{ user_home }}/dotfiles" dotfiles_repo: https://codeberg.org/bartal-lsn/dotfiles.git dotfiles_ssh_repo: git@codeberg.org:bartal-lsn/dotfiles.git +jdtls_version: "1.60.0" +jdtls_base_url: "https://download.eclipse.org/jdtls/milestones/{{ jdtls_version }}" +jdtls_install_dir: "{{ user_home }}/.local/share/jdtls" +jdtls_archive: /tmp/jdtls.tar.gz system_timezone: Atlantic/Faroe system_locale: en_US.UTF-8 @@ -13,7 +17,6 @@ keyboard_layout: fo upgrade_system: true install_virtualization: true install_sqlcmd: true -install_typora: true fedora_packages: # Media and documents