Make ghautomatrop work with Junest

This commit is contained in:
Geoffrey Frogeye 2021-12-02 16:55:55 +01:00
parent 3ff188c80b
commit 2250f520fe
9 changed files with 65 additions and 22 deletions

View file

@ -1 +1 @@
self_hostname
self_name

View file

@ -167,6 +167,7 @@
loop:
- pulseaudio
- mpd
when: has_systemd
# TODO bar (might change bar in the future, so...)
# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config)

View file

@ -4,9 +4,17 @@
arch: "{{ ansible_lsb.id == 'Arch' }}"
manjaro: "{{ ansible_lsb.id == 'Manjaro' or ansible_lsb.id == 'Manjaro-ARM' }}"
termux: "{{ ansible_distribution == 'OtherLinux' and ansible_python.executable == '/data/data/com.termux/files/usr/bin/python' }}"
debian_based: "{{ ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' }}"
debian: "{{ ansible_distribution == 'Debian' }}"
ubuntu: "{{ ansible_distribution == 'Ubuntu' }}"
junest: "{{ ansible_distribution == 'Archlinux' and ansible_is_chroot }}" # TODO Check if /etc/junest exists
tags:
- always
- name: Set composed facts
set_fact:
debian_based: "{{ debian or ubuntu }}"
can_chown: "{{ not junest }}"
has_systemd: "{{ not junest }}"
tags:
- always
# TODO Make this a real Ansible fact maybe?

View file

@ -15,3 +15,9 @@
listen: "software changed"
when: root_access
when: arch_based
- name: update pacman cache
pacman:
update_cache: yes
become: yes
when: arch_based

View file

@ -59,6 +59,30 @@
# Arch configuration
# TODO Patch sudo-fake so it allows using -u so `become` works
- name: Enable multilib repo
lineinfile:
path: /etc/pacman.conf
regexp: '^#?\s*\[multilib\]$'
line: '[multilib]'
become: yes
when: arch_based and ansible_architecture == "x86_64"
notify: udpate pacman cache
- name: Configure multilib repo
lineinfile:
path: /etc/pacman.conf
regexp: '^#?\s*Include\s*=\s*/etc/pacman.d/mirrorlist'
line: 'Include = /etc/pacman.d/mirrorlist'
insertafter: '^\[multilib\]$'
become: yes
when: arch_based and ansible_architecture == "x86_64"
notify: udpate pacman cache
- name: Update cache if needed
meta: flush_handlers
- name: Install ccache
pacman:
name: ccache
@ -90,7 +114,6 @@
replace: "CFLAGS=\\1\\2"
become: yes
when: arch_based
tags: g
- name: Change -march to native from makepkg CFLAGS
replace:
@ -99,7 +122,6 @@
replace: "CFLAGS=\\1-march=native\\2\\3"
become: yes
when: arch_based
tags: g
- name: Set makepkg MAKEFLAGS
replace:
@ -140,24 +162,30 @@
# Install alternative package managers
- name: List packages from base-devel
command: pacman -Sqg base-devel
register: base_devel_packages
changed_when: no
check_mode: no
- name: Install dependencies for AUR helpers
pacman:
name:
- fakeroot
- base-devel
name: "{{ (base_devel_packages.stdout | split('\n') | reject('eq', 'sudo')) + ['fakeroot'] }}"
become: yes
when: arch_based and root_access
when: arch_based
# Do not install sudo because maybe sudo-fake is installed (otherwise it conflicts)
# It should already be installed already anyway
- name: Install AUR package manager (Arch)
aur:
name: yay-bin
when: arch and root_access
when: arch
- name: Install AUR package manager (Manjaro)
pacman:
name: yay
become: yes
when: manjaro and root_access
when: manjaro
# Not sure if regular Manjaro has yay in its community packages,
# but Manjaro-ARM sure does
@ -172,13 +200,6 @@
packages: "{{ query('template', 'package_manager.j2')[0].split('\n')[:-1]|sort|unique }}"
tags: softwarelist
- name: Check if list of packages changed
copy:
content: "{% for package in packages %}{{ package }}\n{% endfor %}"
dest: "{{ ansible_user_dir }}/.cache/automatrop/package_manager"
notify: "software changed"
tags: softwarelist
- name: Install packages (Arch-based)
aur:
name: "{{ packages }}"
@ -189,7 +210,14 @@
use: yay
notify: "software changed"
tags: softwarelist
when: arch_based and root_access
when: arch_based
- name: Check if list of packages changed
copy:
content: "{% for package in packages %}{{ package }}\n{% endfor %}"
dest: "{{ ansible_user_dir }}/.cache/automatrop/package_manager"
notify: "software changed"
tags: softwarelist
# translate-shell
# $ curl -L git.io/trans > ~/.local/bin/trans

View file

@ -5,7 +5,7 @@ rsync
borg
syncthing
{% if arch_based %}
{% if ansible_architecture == 'x86_64' %}
{% if ansible_architecture == 'x86_64' and can_chown %}
freefilesync-bin
{# Not worth the compilation if you can't have the binaries #}
{% endif %}

View file

@ -1,7 +1,9 @@
moreutils
man
visidata
{% if can_chown or not arch_based %}
insect
{% endif %}
translate-shell
gnupg
{# Editor #}

View file

@ -3,7 +3,6 @@
vim_variants:
- vim
- nvim
tags: g
# TODO vim-minimal for bsh
# TODO Select those in a clever way
@ -25,7 +24,6 @@
src: loader.j2
dest: "{{ ansible_user_dir }}/.config/vim/loader.vim"
mode: "u=rw,g=r,o=r"
tags: g
- name: Install theme
template:
@ -54,4 +52,3 @@
loop: "{{ vim_variants }}"
loop_control:
loop_var: variant
tags: g

View file

@ -0,0 +1 @@
gho.geoffrey.frogeye.fr