From d09b3cc85286e121de2fcbfc37d32cac5ccd2953 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Tue, 26 Nov 2019 08:38:36 +0000 Subject: [PATCH] Add aerc config --- states/aerc/arch.sls | 3 +++ states/aerc/files/accounts.jinja | 9 +++++++++ states/aerc/init.sls | 23 +++++++++++++++++++++++ states/dotfiles.sls | 1 + 4 files changed, 36 insertions(+) create mode 100644 states/aerc/arch.sls create mode 100644 states/aerc/files/accounts.jinja create mode 100644 states/aerc/init.sls diff --git a/states/aerc/arch.sls b/states/aerc/arch.sls new file mode 100644 index 0000000..da2fe3b --- /dev/null +++ b/states/aerc/arch.sls @@ -0,0 +1,3 @@ +ensure aerc is installed: + pkg.installed: + - name: aerc-git diff --git a/states/aerc/files/accounts.jinja b/states/aerc/files/accounts.jinja new file mode 100644 index 0000000..f60d0b0 --- /dev/null +++ b/states/aerc/files/accounts.jinja @@ -0,0 +1,9 @@ +{% set pword_cmd = "pass webmail.friedersdorff.com/max@friedersdorff.com | head -n 1" %} +[Personal] +source = imaps://max%40friedersdorff.com@mail.friedersdorff.com +source-cred-cmd = "{{ pword_cmd }}" +outgoing = smtps+plain://max%40friedersdorff.com@mail.friedersdorff.com +outgoing-cred-cmd = "{{ pword_cmd }}" +default = INBOX +from = Maximilian Friedersdorff +copy-to = Sent diff --git a/states/aerc/init.sls b/states/aerc/init.sls new file mode 100644 index 0000000..3598c5c --- /dev/null +++ b/states/aerc/init.sls @@ -0,0 +1,23 @@ +include: + - aerc.{{ grains['os'] | lower}} + +ensure aerc config dir: + file.directory: + - name: {{ grains['homedir'] }}/.config/aerc + - user: {{ grains['user'] }} + - group: {{ grains['user'] }} + - dir_mode: 700 + - file_mode: 600 + - recurse: + - user + - group + - mode + +aerc config file: + file.managed: + - name: {{ grains['homedir'] }}/.config/aerc/accounts.conf + - source: salt://aerc/files/accounts.jinja + - template: jinja + - user: {{ grains['user'] }} + - group: {{ grains['user'] }} + - mode: 600 diff --git a/states/dotfiles.sls b/states/dotfiles.sls index 3027027..77e6662 100644 --- a/states/dotfiles.sls +++ b/states/dotfiles.sls @@ -8,3 +8,4 @@ include: - termite - qutebrowser - tmux + - aerc -- 2.46.2