From b5dfc6c811e5d42d6f61e2f9485fc5836d76c8f2 Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Sat, 18 Jan 2025 00:53:04 +0100 Subject: [PATCH] Installing neovim from binary on Ubuntu --- .config/fish/config.fish | 5 ++++ ...all_dev_tools.yml => install_dotfiles.yml} | 30 ++++++++++++++++++- README.md | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) rename .local/share/dotfiles/{install_dev_tools.yml => install_dotfiles.yml} (74%) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 80a11bc..acc0e12 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,5 +1,10 @@ if status is-interactive fish_add_path -p $HOME/.local/bin + + if test -d /opt/nvim-linux64/bin + fish_add_path -a /opt/nvim-linux64/bin + end + switch (whoami) # Corporate machine case Ivan_Golikov diff --git a/.local/share/dotfiles/install_dev_tools.yml b/.local/share/dotfiles/install_dotfiles.yml similarity index 74% rename from .local/share/dotfiles/install_dev_tools.yml rename to .local/share/dotfiles/install_dotfiles.yml index 38594d7..9e87a86 100644 --- a/.local/share/dotfiles/install_dev_tools.yml +++ b/.local/share/dotfiles/install_dotfiles.yml @@ -2,7 +2,6 @@ - hosts: all vars: common_packages: - - neovim - ripgrep - tree - gcc @@ -13,10 +12,12 @@ - fzf brew_packages: + - neovim - difftastic - fd pacman_packages: + - neovim - difftastic - fd @@ -78,6 +79,33 @@ pkg: "{{ common_packages }}" cache_valid_time: 3600 + - name: Install Neovim (Ubuntu) + when: is_ubuntu + block: + - name: Create a temporary directory + ansible.builtin.tempfile: + state: directory + prefix: uv_temp_ + register: temp_dir + + - name: Download Neovim tarball + ansible.builtin.get_url: + url: 'https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz' + dest: "{{ temp_dir.path }}/nvim.tar.gz" + mode: 'u=r,g=,o=' + + - name: Unpack the tarball + become: true + ansible.builtin.unarchive: + src: "{{ temp_dir.path }}/nvim.tar.gz" + dest: "/opt" + remote_src: true + + - name: Clean up temporary directory + ansible.builtin.file: + path: "{{ temp_dir.path }}" + state: absent + - name: Install uv packages ansible.builtin.command: "uv tool install --python {{ item.python | default(uv_tools_default_python) }} {{ item.name }}" register: uv_install_result diff --git a/README.md b/README.md index caa6810..00a1ae9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ $ alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' $ dotfiles checkout $ dotfiles config --local status.showUntrackedFiles no $ cd .local/share/dotfiles -$ uv run ansible-playbook install_dev_tools.yml +$ uv run ansible-playbook install_dotfiles.yml ``` ## TODO