feat: add pacman hook for recompiling xmonad

This commit is contained in:
Max Hohlfeld 2025-03-21 10:53:26 +01:00
parent 0749a6750e
commit 4f53845c92
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,9 @@
[Trigger]
Operation = Upgrade
Type = Package
Target = xmonad
[Action]
Description = Recompiling xmonad...
When = PostTransaction
Exec = /usr/bin/sudo -u max /usr/bin/xmonad --recompile

View File

@ -38,7 +38,7 @@
become: true
ansible.builtin.lineinfile:
path: /etc/sudo.conf
line: 'max ALL=(ALL) NOPASSWD: /usr/bin/pacman'
line: 'max ALL=(ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/mkdir, /usr/bin/cp'
state: present
validate: 'visudo -cf %s'
@ -48,7 +48,22 @@
state: present
name:
- pmount
- advmvcp
- advcpmv
- name: Create pacman hook directory
become: true
ansible.builtin.file:
path: /etc/pacman.d/hooks
state: directory
mode: '0755'
- name: Copy over xmonad pacman hook
become: true
ansible.builtin.copy:
src: recompile_xmonad.hook
dest: /etc/pacman.d/recompile_xmonad.hook
mode: '0644'
always:
- name: Disable user to use sudo pacman without password
become: true