From 9ace7f640996bb3e95f8233a74ef980af3a35559 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 11 Oct 2018 10:09:29 +0200 Subject: [PATCH] roundcube: clean-up and add test --- nixos/modules/services/mail/roundcube.nix | 143 +++++++++++++++------- nixos/tests/roundcube.nix | 28 +++++ 2 files changed, 128 insertions(+), 43 deletions(-) create mode 100644 nixos/tests/roundcube.nix diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix index 4639af33b63c..b4ab429b5200 100644 --- a/nixos/modules/services/mail/roundcube.nix +++ b/nixos/modules/services/mail/roundcube.nix @@ -9,65 +9,98 @@ in options.services.roundcube = { enable = mkEnableOption "Roundcube"; - listenAddress = mkOption { - type = types.str; - default = "[::]"; - description = "Listening address. IPv6 addresses must be enclosed in square brackets"; + nginx.enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable nginx virtual host management. + Further nginx configuration can be done by adapting services.nginx.virtualHosts.<name>. + See for further information. + ''; }; - listenPort = mkOption { - type = types.int; - default = 80; - description = "Listening port"; - }; - - subDomain = mkOption { + hostName = mkOption { type = types.str; example = "webmail"; - description = "Sub-domain to use which is the name of the nginx vhost"; + description = "Host name to use which for the nginx vhost"; }; - - extraConfig = mkOption { - type = types.str; - default = '' - start; + $roundcube->waitForUnit("postgresql.service"); + $roundcube->waitForUnit("phpfpm-roundcube.service"); + $roundcube->succeed("curl -sSfL http://roundcube/"); + ''; +})