diff options
Diffstat (limited to 'users')
-rw-r--r-- | users/id1000.scm | 148 |
1 files changed, 144 insertions, 4 deletions
diff --git a/users/id1000.scm b/users/id1000.scm index 1f173cf..c4d0cea 100644 --- a/users/id1000.scm +++ b/users/id1000.scm @@ -31,16 +31,157 @@ ;; %suweren-home-services #:use-module (suweren home)) -;; (list string) +(define dovecot-imap-login-inet-configuration + ((@ (gnu services mail) + inet-listener-configuration) + (address "192.168.10.2") + (port 993) + (protocol "imaps"))) + +(define dovecot-lmtp-inet-configuration + ((@ (gnu services mail) + inet-listener-configuration) + (address "192.168.10.2 127.0.0.1") + (port 24) + (protocol "lmtp"))) + +(define dovecot-lmtp-unix-configuration + ((@ (gnu services mail) + unix-listener-configuration) + (group "vmail") + (mode "0666") + (path "lmtp") + (user "vmail"))) + +(define mailbox-marekpasnikowski-archive + ((@ (gnu services mail) + mailbox-configuration) + (name "Archive") + (auto "subscribe") + (special-use (list "\\Archive")))) + +(define mailbox-marekpasnikowski-drafts + ((@ (gnu services mail) + mailbox-configuration) + (name "Drafts") + (auto "subscribe") + (special-use (list "\\Drafts")))) + +(define mailbox-marekpasnikowski-junk + ((@ (gnu services mail) + mailbox-configuration) + (name "Junk") + (auto "subscribe") + (special-use (list "\\Junk")))) + +(define mailbox-marekpasnikowski-sent + ((@ (gnu services mail) + mailbox-configuration) + (name "Sent") + (auto "subscribe") + (special-use (list "\\Sent")))) + +(define mailbox-marekpasnikowski-trash + ((@ (gnu services mail) + mailbox-configuration) + (name "Trash") + (auto "subscribe") + (special-use (list "\\Trash")))) + +;;; + +(define dovecot-imap + ((@ (gnu services mail) + protocol-configuration) + (name "imap"))) + +(define dovecot-imap-login-configuration + ((@ (gnu services mail) + service-configuration) + (kind "imap-login") + (listeners (list dovecot-imap-login-inet-configuration)))) + +(define dovecot-lmtp + ((@ (gnu services mail) + protocol-configuration) + (name "lmtp"))) + +(define dovecot-lmtp-configuration + ((@ (gnu services mail) + service-configuration) + (kind "lmtp") + (listeners (list dovecot-lmtp-inet-configuration + dovecot-lmtp-unix-configuration)))) + +(define dovecot-passwd-file + ((@ (gnu services mail) + passdb-configuration) + (args (list "username_format=%n" + "/secrets/dovecot")) + (driver "passwd-file"))) + +(define dovecot-namespace-marekpasnikowski + ((@ (gnu services mail) + namespace-configuration) + (name "inbox") + (inbox? #t) + (mailboxes (list mailbox-marekpasnikowski-archive + mailbox-marekpasnikowski-drafts + mailbox-marekpasnikowski-junk + mailbox-marekpasnikowski-sent + mailbox-marekpasnikowski-trash)))) + +(define dovecot-userdb-static-configuration + ((@ (gnu services mail) + userdb-configuration) + (args (list "gid=vmail" + "home=/home/vmail/%n" + "uid=vmail")) + (driver "static"))) + +(define ssl-cert-path + (string-append "</etc/letsencrypt/live/" + "marekpasnikowski.pl" + "/fullchain.pem")) + +(define ssl-key-path + (string-append "</etc/letsencrypt/live/" + "marekpasnikowski.pl" + "privkey.pem")) + +;;; + +(define dovecot-configuration* + ((@ (gnu services mail) + dovecot-configuration) + (disable-plaintext-auth? #t) + (mail-location "maildir:~/Maildir") + (namespaces (list dovecot-namespace-marekpasnikowski)) + (passdbs (list dovecot-passwd-file)) + (protocols (list dovecot-imap + dovecot-lmtp)) + (services (list dovecot-lmtp-configuration + dovecot-imap-login-configuration)) + (ssl? "required") + (ssl-cert ssl-cert-path) + (ssl-key ssl-key-path) + (ssl-min-protocol "TLSv1.2") + (userdbs (list dovecot-userdb-static-configuration)))) + (define groups (list "kvm" "wheel")) -;; string +;;; + +(define-public dovecot-service + (service (@ (gnu services mail) + dovecot-service-type) + dovecot-configuration*)) + (define-public uid1000-name "marek") -;; record* user-account (define-public uid1000-account (user-account (name uid1000-name) (group "users") @@ -49,7 +190,6 @@ (comment "Marek Paśnikowski") (home-directory "/home/marek"))) -;; record home-environment (define-public uid1000-home-environment (lambda (host-name*) (let* ((gitconfig-file (local-file "uid1000-gitconfig")) ; TODO modularize |