aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile20
-rw-r--r--src/org/euandre/queue.scm83
-rw-r--r--tests/internet-system.scm (renamed from tests/test-system.scm)11
-rw-r--r--tests/local-system.scm25
4 files changed, 102 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 31686c0..9cdb2db 100644
--- a/Makefile
+++ b/Makefile
@@ -4,18 +4,24 @@
all: EuAndreh.key guix nix
-guix: all-packages all-services
+guix: guix-packages guix-services
-nix:
- nix-build build.nix
-
-all-packages:
+guix-packages:
guix build -v3 -Lsrc/ -K \
-f src/org/euandre/packages.scm \
-f src/org/euandre/queue.scm \
-all-services:
- guix system -v3 -Lsrc/ -K build tests/test-system.scm
+guix-services-local:
+ guix system -v3 -Lsrc/ -K build tests/local-system.scm
+
+guix-services-internet:
+ guix system -v3 -Lsrc/ -K build tests/internet-system.scm
+
+guix-services: guix-services-local guix-services-internet
+
+nix:
+ nix-build build.nix
+
refresh:
sh scripts/paku -rg
diff --git a/src/org/euandre/queue.scm b/src/org/euandre/queue.scm
index 3fe4db2..2485b97 100644
--- a/src/org/euandre/queue.scm
+++ b/src/org/euandre/queue.scm
@@ -120,7 +120,8 @@
postfix-etc-files
postfix-setuid-programs
postfix-shepherd-service
- postfix-service-type
+ local-postfix-service-type
+ internet-postfix-service-type
dovecot2-service-type
@@ -1012,6 +1013,7 @@ milter_default_action = accept
(group setgid-group)))
'()))))
+;; FIXME: parameterize /var/mail
(define (postfix-activation config)
(match-record config <postfix-configuration>
(queue-directory)
@@ -1144,32 +1146,67 @@ max_age: 604800
(cyrus-service-configuration
(name "smtpd.conf"))))
+(define local-postfix-service-extensions
+ (list
+ (service-extension etc-service-type
+ postfix-etc-files)
+ (service-extension account-service-type
+ postfix-accounts)
+ (service-extension setuid-program-service-type
+ postfix-setuid-programs)
+ (service-extension activation-service-type
+ postfix-activation)
+ (service-extension profile-service-type
+ (compose list postfix-configuration-postfix))
+ (service-extension shepherd-root-service-type
+ postfix-shepherd-service)))
+
+(define local-postfix-service-type
+ (service-type
+ (name 'postfix)
+ (extensions local-postfix-service-extensions)
+ (default-value (postfix-configuration))
+ (description
+ "
+ Run the Postfix MTA.
+
+ This is the top-level system service for Postfix.
+
+ It includes:
+ - populating /etc/postfix/ with read-only configuration files;
+ - the user and groups used by Postfix when handling email delivery;
+ - the special setgid binaries for daily usage, such as \"sendmail\";
+ - the Shepherd service for starting, stopping and *reloading* the
+ service without restarting it;
+ - the activation script for creating the required directories and
+ configuring them with the correct permissions;
+ - the binaries in the system profile so that one doesn't need to explicilty
+ include the package when the service is already enabled.
+
+ An extension to the log-rotation service isn't included: the default
+ rottlog configuration already includes /var/log/maillog in its routine,
+ so it is kept out.
+
+ The defaults of <postfix-configuration> provide sane default values for
+ most things, such as group names, data and queue directories, etc. When
+ used as-is, it creates a Postfix server that sends email from local users
+ of the domain provided by \"/etc/hostname\".")))
-(define postfix-service-type
+(define internet-postfix-service-type
(service-type
(name 'postfix)
(extensions
- (list
- (service-extension etc-service-type
- postfix-etc-files)
- (service-extension account-service-type
- postfix-accounts)
- (service-extension setuid-program-service-type
- postfix-setuid-programs)
- (service-extension activation-service-type
- postfix-activation)
- (service-extension mail-aliases-service-type
- postfix-aliases)
- (service-extension profile-service-type
- (compose list postfix-configuration-postfix))
- (service-extension shepherd-root-service-type
- postfix-shepherd-service)
- (service-extension nginx-service-type
- postfix-nginx-locations)
- (service-extension certbot-service-type
- postfix-certificates)
- (service-extension cyrus-sasl-service-type
- postfix-sasl-services)))
+ (append
+ local-postfix-service-extensions
+ (list
+ (service-extension mail-aliases-service-type
+ postfix-aliases)
+ (service-extension nginx-service-type
+ postfix-nginx-locations)
+ (service-extension certbot-service-type
+ postfix-certificates)
+ (service-extension cyrus-sasl-service-type
+ postfix-sasl-services))))
(default-value (postfix-configuration))
(description
"
diff --git a/tests/test-system.scm b/tests/internet-system.scm
index d49541c..1267911 100644
--- a/tests/test-system.scm
+++ b/tests/internet-system.scm
@@ -1,16 +1,13 @@
(use-modules
((org euandre queue) #:prefix queue:)
(gnu))
-(use-package-modules
- ssh)
+(use-package-modules)
(use-service-modules
certbot
- mail
- networking
- ssh)
+ mail)
(operating-system
- (host-name "a-test-host")
+ (host-name "a-internet-test-host")
(services
(append
(list
@@ -18,7 +15,7 @@
(service queue:dkimproxyout-service-type)
(service queue:cyrus-sasl-service-type)
(service queue:dovecot2-service-type)
- (service queue:postfix-service-type)
+ (service queue:internet-postfix-service-type)
(service certbot-service-type (certbot-configuration))
(service mail-aliases-service-type '()))
%base-services))
diff --git a/tests/local-system.scm b/tests/local-system.scm
new file mode 100644
index 0000000..abf09a8
--- /dev/null
+++ b/tests/local-system.scm
@@ -0,0 +1,25 @@
+(use-modules
+ ((org euandre queue) #:prefix queue:)
+ (gnu))
+(use-package-modules)
+(use-service-modules)
+
+(operating-system
+ (host-name "a-local-test-host")
+ (services
+ (append
+ (list
+ (service queue:local-postfix-service-type))
+ %base-services))
+ (bootloader
+ (bootloader-configuration
+ (bootloader grub-bootloader)))
+ (file-systems
+ (append
+ (list
+ (file-system
+ (mount-point "/")
+ (type "btrfs")
+ (device
+ (uuid "2c66de32-dde7-ea35-750a-a1ca47a58d45" 'btrfs))))
+ %base-file-systems)))