about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMarek Mahut <marek.mahut@gmail.com>2020-03-30 13:29:30 +0200
committerMarek Mahut <marek.mahut@gmail.com>2020-03-30 13:29:30 +0200
commit05195040c0006c0601075ee092031f2c2d2d04e0 (patch)
tree9d4d7f3f03b9dfa6401e4074c9a79ef5459b659b /nixos
parent7fedac34b1063091fff4cd8fceb747f9918286ac (diff)
downloadnixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar.gz
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar.bz2
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar.lz
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar.xz
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.tar.zst
nixlib-05195040c0006c0601075ee092031f2c2d2d04e0.zip
nixos/magic-wormhole-mailbox-server: init
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/mail/magic-wormhole-mailbox-server.nix28
2 files changed, 29 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index c2a96c72d165..dafece285b64 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -394,6 +394,7 @@
   ./services/mail/mailcatcher.nix
   ./services/mail/mailhog.nix
   ./services/mail/mailman.nix
+  ./services/mail/magic-wormhole-mailbox-server.nix
   ./services/mail/mlmmj.nix
   ./services/mail/offlineimap.nix
   ./services/mail/opendkim.nix
diff --git a/nixos/modules/services/mail/magic-wormhole-mailbox-server.nix b/nixos/modules/services/mail/magic-wormhole-mailbox-server.nix
new file mode 100644
index 000000000000..09d357cd2b6e
--- /dev/null
+++ b/nixos/modules/services/mail/magic-wormhole-mailbox-server.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.magic-wormhole-mailbox-server;
+  dataDir = "/var/lib/magic-wormhole-mailbox-server;";
+  python = pkgs.python3.withPackages (py: [ py.magic-wormhole-mailbox-server py.twisted ]);
+in
+{
+  options.services.magic-wormhole-mailbox-server = {
+    enable = mkEnableOption "Enable Magic Wormhole Mailbox Server";
+  };
+
+  config = mkIf cfg.enable {
+    systemd.services.magic-wormhole-mailbox-server = {
+      after = [ "network.target" ];
+      wantedBy = [ "multi-user.target" ];
+      serviceConfig = {
+        DynamicUser = true;
+        ExecStart = "${python}/bin/twistd --nodaemon wormhole-mailbox";
+        WorkingDirectory = dataDir;
+        StateDirectory = baseNameOf dataDir;
+      };
+    };
+
+  };
+}