diff --git a/nixos/modules/services/mail/postfixadmin.nix b/nixos/modules/services/mail/postfixadmin.nix index 87a9f963b195..7523fa4930ab 100644 --- a/nixos/modules/services/mail/postfixadmin.nix +++ b/nixos/modules/services/mail/postfixadmin.nix @@ -1,7 +1,4 @@ { lib, config, pkgs, ... }: - -with lib; - let cfg = config.services.postfixadmin; fpm = config.services.phpfpm.pools.postfixadmin; @@ -10,8 +7,8 @@ let in { options.services.postfixadmin = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable postfixadmin. @@ -22,14 +19,14 @@ in ''; }; - hostName = mkOption { - type = types.str; + hostName = lib.mkOption { + type = lib.types.str; example = "postfixadmin.example.com"; description = "Hostname to use for the nginx vhost"; }; - adminEmail = mkOption { - type = types.str; + adminEmail = lib.mkOption { + type = lib.types.str; example = "postmaster@example.com"; description = '' Defines the Site Admin's email address. @@ -38,8 +35,8 @@ in ''; }; - setupPasswordFile = mkOption { - type = types.path; + setupPasswordFile = lib.mkOption { + type = lib.types.path; description = '' Password file for the admin. Generate with `php -r "echo password_hash('some password here', PASSWORD_DEFAULT);"` @@ -47,16 +44,16 @@ in }; database = { - username = mkOption { - type = types.str; + username = lib.mkOption { + type = lib.types.str; default = "postfixadmin"; description = '' Username for the postgresql connection. If `database.host` is set to `localhost`, a unix user and group of the same name will be created as well. ''; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; default = "localhost"; description = '' Host of the postgresql server. If this is not set to @@ -65,25 +62,25 @@ in permissions. ''; }; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; description = "Password file for the postgresql connection. Must be readable by user `nginx`."; }; - dbname = mkOption { - type = types.str; + dbname = lib.mkOption { + type = lib.types.str; default = "postfixadmin"; description = "Name of the postgresql database"; }; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = "Extra configuration for the postfixadmin instance, see postfixadmin's config.inc.php for available options."; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.etc."postfixadmin/config.local.php".text = ''