add wait variable for goimapnotify

Previously `wait` could be defined in the user's config file, but in the
new release it appears to only be supported as a flag, so we have to
override the systemd service.
This commit is contained in:
Pig Monkey 2024-09-16 15:56:35 -07:00
parent 6e81116824
commit de59ed760b
7 changed files with 31 additions and 5 deletions

View file

@ -0,0 +1,19 @@
---
- name: Install goimapnotify
pacman:
name: goimapnotify
state: present
- name: Create goimapnotify service override directory
file:
path: /etc/systemd/user/goimapnotify@.service.d
state: directory
when: mail.goimapnotify_wait is defined
- name: Push goimapnotify service override file
template:
src: goimapnotify-service-override.conf.j2
dest: /etc/systemd/user/goimapnotify@.service.d/override.conf
when: mail.goimapnotify_wait is defined
notify:
- reload user systemd config

View file

@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=/usr/bin/goimapnotify -conf %h/.config/imapnotify/%i.yaml -wait {{ mail.goimapnotify_wait }}

View file

View file

@ -76,11 +76,6 @@
regexp: "^x-scheme-handler/mailto="
line: "x-scheme-handler/mailto=mutt.desktop"
- name: Install goimapnotify
pacman:
name: goimapnotify
state: present
- include_tasks: msmtp.yml
- include_tasks: isync.yml
#- include_tasks: offlineimap.yml

View file

@ -1,3 +1,10 @@
---
- name: reload systemd config
command: systemctl daemon-reload
- name: reload user systemd config
command: systemctl --user daemon-reload
become: yes
become_user: "{{ user.name }}"
environment:
XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"