1 { config, lib, pkgs, ... }:
6 cfg = config.services.magic-wormhole-mailbox-server;
7 dataDir = "/var/lib/magic-wormhole-mailbox-server;";
8 python = pkgs.python3.withPackages (py: [ py.magic-wormhole-mailbox-server py.twisted ]);
11 options.services.magic-wormhole-mailbox-server = {
12 enable = mkEnableOption (lib.mdDoc "Magic Wormhole Mailbox Server");
15 config = mkIf cfg.enable {
16 systemd.services.magic-wormhole-mailbox-server = {
17 after = [ "network.target" ];
18 wantedBy = [ "multi-user.target" ];
21 ExecStart = "${python}/bin/twistd --nodaemon wormhole-mailbox";
22 WorkingDirectory = dataDir;
23 StateDirectory = baseNameOf dataDir;