Updated arch config

master
mandlm 2021-01-28 14:27:05 +01:00
parent 7bacbc8662
commit d2b7c0fd5d
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
10 changed files with 119 additions and 30 deletions

View File

@ -7,10 +7,11 @@
become: yes
roles:
- user-account
- sudo
- dotfiles
- git
- tmux
- zsh
- neovim
- vimwiki
- tools
- dev-machine

View File

@ -3,6 +3,7 @@
package:
name:
- git
- openssh
state: latest
- name: clone dotfiles

View File

@ -3,7 +3,6 @@
package:
name:
- git
- git-flow
state: latest
- name: install git config

View File

@ -0,0 +1,67 @@
---
- name: install prerequisites (apt)
package:
name:
- nodejs
- npm
- python
- python-pip
- ripgrep
state: latest
- name: install prerequisites (pip)
become_user: "{{ account.name }}"
pip:
name:
- pynvim
state: latest
extra_args: --user
- name: download neovim appimage
get_url:
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
dest: /tmp
mode: "0755"
- name: extract neovim appimage
shell: |
rm -rf /usr/local/bin/nvim.appimage
/tmp/nvim.appimage --appimage-extract
mv squashfs-root /usr/local/bin/nvim.appimage
chmod -R 4755 /usr/local/bin/nvim.appimage
chmod -R -s /usr/local/bin/nvim.appimage
rm -f /tmp/nvim.appimage
args:
chdir: /tmp
- name: install neovim link
alternatives:
name: nvim
path: /usr/local/bin/nvim.appimage/usr/bin/nvim
link: /usr/bin/nvim
- name: create nvim plugin directory
become_user: "{{ account.name }}"
file:
path: "{{ account.home }}/.local/share/nvim/site/autoload/"
state: directory
- name: install vim-plug
become_user: "{{ account.name }}"
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: "{{ account.home }}/.local/share/nvim/site/autoload/plug.vim"
- name: install nvim config
become_user: "{{ account.name }}"
shell:
chdir: "{{ dotfiles }}/nvim"
cmd: ./install.sh
creates: "{{ account.home }}/.config/nvim/init.vim"
- name: install nvim plugins
become_user: "{{ account.name }}"
shell:
cmd: nvim +PlugInstall +PlugUpdate +qall

View File

@ -4,7 +4,8 @@
name:
- nodejs
- npm
- python3
- python
- python-pip
- ripgrep
state: latest
@ -16,28 +17,11 @@
state: latest
extra_args: --user
- name: download neovim appimage
get_url:
url: https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
dest: /tmp
mode: "0755"
- name: extract neovim appimage
shell: |
rm -rf /usr/local/bin/nvim.appimage
/tmp/nvim.appimage --appimage-extract
mv squashfs-root /usr/local/bin/nvim.appimage
chmod -R 4755 /usr/local/bin/nvim.appimage
chmod -R -s /usr/local/bin/nvim.appimage
rm -f /tmp/nvim.appimage
args:
chdir: /tmp
- name: install neovim link
alternatives:
name: nvim
path: /usr/local/bin/nvim.appimage/usr/bin/nvim
link: /usr/bin/nvim
- name: install neovim
package:
name:
- neovim
state: latest
- name: create nvim plugin directory
become_user: "{{ account.name }}"

View File

@ -0,0 +1,22 @@
---
- name: install sudo
package:
name:
- sudo
state: latest
- name: add user to sudoer group
user:
name: "{{ account.name }}"
groups: "{{ sudo_group }}"
append: yes
- name: activate sudoers group
lineinfile:
dest: /etc/sudoers
state: present
regexp: "^%{{ sudo_group }}"
line: "%{{ sudo_group }} ALL=(ALL) ALL"
insertafter: "^#\\s*%{{ sudo_group }}"
firstmatch: true
validate: "visudo -cf %s"

View File

@ -0,0 +1,3 @@
---
sudo_group: "{{ 'sudo' if ansible_facts['os_family'] == 'Debian' else 'wheel' }}"

View File

@ -4,6 +4,7 @@
name:
- tree
state: latest
- name: install debian tools
package:
name:

View File

@ -6,7 +6,6 @@
create_home: yes
state: present
update_password: always
groups: sudo
register: account
- name: ensure .ssh exists
@ -19,8 +18,20 @@
- name: copy ssh key
become_user: "{{ account.name }}"
copy:
src: "{{ item }}"
src: "ssh/"
dest: "/home/{{ account.name }}/.ssh/"
mode: "0600"
with_fileglob:
- "/mnt/c/Users/mandl/.ssh/id_rsa*"
- name: ensure .gnupg exists
become_user: "{{ account.name }}"
file:
path: "/home/{{ account.name }}/.gnupg"
state: directory
mode: "0700"
- name: copy gpg keys
become_user: "{{ account.name }}"
copy:
src: "gnupg/"
dest: "/home/{{ account.name }}/.gnupg/"
mode: "0600"

View File

@ -14,7 +14,7 @@
- git
- tmux
- zsh
- neovim
- neovim-appimage
- vimwiki
- tools
- dev-machine