system-from-scratch/roles/neovim/tasks/main.yml

47 lines
1.2 KiB
YAML

- name: Check if neovim exists
stat:
path: /usr/local/bin/nvim
register: stat_result
- name: Clone neovim repository
when: not stat_result.stat.exists
ansible.builtin.git:
repo: https://github.com/neovim/neovim
dest: "{{ ansible_env.HOME }}/src/neovim"
version: v0.9.5
- name: Install build dependencies
when: not stat_result.stat.exists
become: true
ansible.builtin.apt:
pkg:
- ninja-build
- gettext
- cmake
- unzip
- curl
- name: Build neovim
when: not stat_result.stat.exists
community.general.make:
chdir: "{{ ansible_env.HOME }}/src/neovim"
params:
CMAKE_BUILD_TYPE: Release
- name: Install neovim
when: not stat_result.stat.exists
become: true
community.general.make:
chdir: "{{ ansible_env.HOME }}/src/neovim"
target: install
- name: Create neovim config dir
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/nvim"
state: directory
mode: '1770'
- name: Copy init.lua
ansible.builtin.copy:
src: files/init.lua
dest: "{{ ansible_env.HOME }}/.config/nvim/init.lua"
mode: '0660'
- name: Copy the rest of neovim config
ansible.builtin.copy:
src: files/lua/
dest: "{{ ansible_env.HOME }}/.config/nvim/lua/"
mode: '1770'