compile neovim from source
This commit is contained in:
parent
b64fd4dc49
commit
cd6fbf4716
4 changed files with 84 additions and 26 deletions
|
@ -1,3 +1,3 @@
|
||||||
dependencies:
|
# dependencies:
|
||||||
- role: common
|
# - role: common
|
||||||
- role: bash
|
# - role: bash
|
||||||
|
|
|
@ -1,62 +1,119 @@
|
||||||
- name: Download Neovim PPA signing key
|
- name: Check if neovim is installed
|
||||||
become: true
|
command:
|
||||||
apt_key:
|
cmd: "which nvim"
|
||||||
keyserver: keyserver.ubuntu.com
|
failed_when: false
|
||||||
id: 9DBB0BE9366964F134855E2255F96FCF8231B6DD
|
changed_when: false
|
||||||
keyring: /etc/apt/trusted.gpg.d/neovim.gpg
|
register: which_nvim
|
||||||
- name: Install Neovim PPA
|
|
||||||
become: true
|
- name: Check local neovim version
|
||||||
apt_repository:
|
command:
|
||||||
repo: "deb [signed-by=/etc/apt/trusted.gpg.d/neovim.gpg] https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu {{ distribution_release }} main"
|
cmd: "nvim --version"
|
||||||
register: apt_repository
|
changed_when: false
|
||||||
- name: Update APT cache
|
check_mode: false
|
||||||
become: true
|
register: current_neovim_version
|
||||||
apt:
|
when: which_nvim.rc == 0
|
||||||
update_cache: true
|
|
||||||
when: apt_repository.changed
|
- name: Set local nvim version as fact if present
|
||||||
- name: Install Neovim
|
set_fact:
|
||||||
become: true
|
current_neovim_version: "{{ current_neovim_version.stdout_lines | default(['no version']) | first }}"
|
||||||
apt:
|
when: which_nvim.rc == 0
|
||||||
name: neovim
|
|
||||||
|
- name: Set local nvim version as fact if not present
|
||||||
|
set_fact:
|
||||||
|
current_neovim_version: "error"
|
||||||
|
when: which_nvim.rc != 0
|
||||||
|
|
||||||
|
- name: Get latest release version
|
||||||
|
uri:
|
||||||
|
url: "https://api.github.com/repos/neovim/neovim/releases/latest"
|
||||||
|
changed_when: false
|
||||||
|
check_mode: false
|
||||||
|
register: latest_stable_neovim_version
|
||||||
|
|
||||||
|
- name: Set latest nvim stable version as fact
|
||||||
|
set_fact:
|
||||||
|
latest_stable_neovim_version: "{{ latest_stable_neovim_version.json.body.splitlines()[1] }}"
|
||||||
|
|
||||||
|
- name: Diff latest release and currently installed
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
neovim_up_to_date: "{{ latest_stable_neovim_version == current_neovim_version }}"
|
||||||
|
|
||||||
|
- name: Build neovim
|
||||||
|
when: not neovim_up_to_date
|
||||||
|
block:
|
||||||
|
- name: Pull neovim github repository
|
||||||
|
git:
|
||||||
|
repo: "https://github.com/neovim/neovim.git"
|
||||||
|
dest: "$HOME/repos/neovim"
|
||||||
|
update: true
|
||||||
|
version: stable
|
||||||
|
|
||||||
|
- name: Compile neovim from source
|
||||||
|
make:
|
||||||
|
chdir: "$HOME/repos/neovim"
|
||||||
|
target: all
|
||||||
|
params:
|
||||||
|
CMAKE_BUILD_TYPE: RelWithDebInfo
|
||||||
|
|
||||||
|
- name: Install neovim from source
|
||||||
|
make:
|
||||||
|
chdir: "/home/{{ ansible_user_id }}/repos/neovim"
|
||||||
|
target: install
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Remove neovim git repo
|
||||||
|
file:
|
||||||
|
path: "$HOME/repos/neovim"
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Create configuration directory
|
- name: Create configuration directory
|
||||||
file:
|
file:
|
||||||
path: ~/.config/nvim
|
path: ~/.config/nvim
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Copy init.lua
|
- name: Copy init.lua
|
||||||
copy:
|
copy:
|
||||||
src: "{{ role_path }}/files/init.lua"
|
src: "{{ role_path }}/files/init.lua"
|
||||||
dest: ~/.config/nvim/init.lua
|
dest: ~/.config/nvim/init.lua
|
||||||
|
|
||||||
- name: Create plugin directory
|
- name: Create plugin directory
|
||||||
file:
|
file:
|
||||||
path: ~/.config/nvim/plugin
|
path: ~/.config/nvim/plugin
|
||||||
state: directory
|
state: directory
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
||||||
- name: Copy plugin configuration files
|
- name: Copy plugin configuration files
|
||||||
copy:
|
copy:
|
||||||
src: "{{ role_path }}/files/plugin/"
|
src: "{{ role_path }}/files/plugin/"
|
||||||
dest: ~/.config/nvim/plugin
|
dest: ~/.config/nvim/plugin
|
||||||
|
|
||||||
- name: Create lua directory
|
- name: Create lua directory
|
||||||
file:
|
file:
|
||||||
path: ~/.config/nvim/lua
|
path: ~/.config/nvim/lua
|
||||||
state: directory
|
state: directory
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
||||||
- name: Copy lua files
|
- name: Copy lua files
|
||||||
copy:
|
copy:
|
||||||
src: "{{ role_path }}/files/lua/"
|
src: "{{ role_path }}/files/lua/"
|
||||||
dest: ~/.config/nvim/lua
|
dest: ~/.config/nvim/lua
|
||||||
|
|
||||||
- name: Install python-lsp-server
|
- name: Install python-lsp-server
|
||||||
pip:
|
pip:
|
||||||
name:
|
name:
|
||||||
- "python-lsp-server[all]"
|
- "python-lsp-server[all]"
|
||||||
|
|
||||||
- name: Clone packer repository
|
- name: Clone packer repository
|
||||||
git:
|
git:
|
||||||
repo: https://github.com/wbthomason/packer.nvim
|
repo: https://github.com/wbthomason/packer.nvim
|
||||||
depth: 1
|
depth: 1
|
||||||
dest: ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
dest: ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
||||||
|
|
||||||
- name: Install terraform-ls
|
- name: Install terraform-ls
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
pkg: terraform-ls
|
pkg: terraform-ls
|
||||||
|
|
||||||
- name: Set default applications
|
- name: Set default applications
|
||||||
ini_file:
|
ini_file:
|
||||||
path: ~/.config/mimeapps.list
|
path: ~/.config/mimeapps.list
|
||||||
|
@ -65,6 +122,7 @@
|
||||||
value: "nvim.desktop"
|
value: "nvim.desktop"
|
||||||
no_extra_spaces: true
|
no_extra_spaces: true
|
||||||
loop: "{{ default_apps }}"
|
loop: "{{ default_apps }}"
|
||||||
|
|
||||||
- name: Copy neovim.bashrc
|
- name: Copy neovim.bashrc
|
||||||
copy:
|
copy:
|
||||||
src: "{{ role_path }}/files/neovim.bashrc"
|
src: "{{ role_path }}/files/neovim.bashrc"
|
||||||
|
|
|
@ -245,7 +245,7 @@ use_authentication=false
|
||||||
username=
|
username=
|
||||||
|
|
||||||
[OSD]
|
[OSD]
|
||||||
Behaviour=3
|
Behaviour=2
|
||||||
CustomText1=%title%
|
CustomText1=%title%
|
||||||
CustomText2=%artist% - %album%
|
CustomText2=%artist% - %album%
|
||||||
CustomTextEnabled=true
|
CustomTextEnabled=true
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
tags: [bash]
|
tags: [bash]
|
||||||
- role: alacritty
|
- role: alacritty
|
||||||
tags: [alacritty]
|
tags: [alacritty]
|
||||||
# - role: neovim
|
- role: neovim
|
||||||
# tags: [neovim]
|
tags: [neovim]
|
||||||
- role: keepassxc
|
- role: keepassxc
|
||||||
tags: [keepassxc]
|
tags: [keepassxc]
|
||||||
- role: wireguard
|
- role: wireguard
|
||||||
|
|
Reference in a new issue