anchor.diff:        '';
         serviceConfig = {
           Type = "simple";
  -        ExecStart = ''${pkgs.postgrey}/bin/postgrey ${bind-flag} --pidfile=/var/run/postgrey.pid --group=postgrey --user=postgrey --dbdir=/var/postgrey --greylist-text="${cfg.greylistText}"'';
  +        ExecStart = ''${pkgs.postgrey}/bin/postgrey ${bind-flag} --group=postgrey --user=postgrey --dbdir=/var/postgrey --delay=${cfg.delay} --max-age=${cfg.maxAge} --retry-window=${cfg.retryWindow} ${if cfg.lookupBySubnet then "--lookup-by-subnet" else "--lookup-by-host"} --ipv4cidr=${cfg.IPv4CIDR} --ipv6cidr=${cfg.IPv6CIDR} ${optionalString cfg.privacy "--privacy"} --auto-whitelist-clients=${if cfg.autoWhitelist == null then "0" else cfg.autoWhitelist} --greylist-text="${cfg.greylistText}" --x-greylist-header="${cfg.greylistHeader}" --greylist-action=${cfg.greylistAction}'';
           Restart = "always";
           RestartSec = 5;
           TimeoutSec = 10;
  
positive.code:         default = false;
          description = "Whether to run the Postgrey daemon";
        };
        inetAddr = mkOption {
          type = nullOr string;
          default = null;
          example = "127.0.0.1";
          description = "The inet address to bind to. If none given, bind to /var/run/postgrey.sock";
        };
        inetPort = mkOption {
          type = int;
          default = 10030;
          description = "The tcp port to bind to";
        };
        greylistText = mkOption {
          type = string;
          default = "Greylisted for %%s seconds";
          description = "Response status text for greylisted messages";
        };
      };
    };
  
negative.code: with lib; let
  
    cfg = config.services.postgrey;
  
    natural = with types; addCheck int (x: x >= 0);
    natural' = with types; addCheck int (x: x > 0);
  
    socket = with types; addCheck (either (submodule unixSocket) (submodule inetSocket)) (x: x ? "path" || x ? "port");
  
    inetSocket = with types; {
      addr = mkOption {
        type = nullOr string;
        default = null;
        example = "127.0.0.1";
        description = "The address to bind to. Localhost if null";
      };
      port = mkOption {
        type = natural';
        default = 10030;
        description = "Tcp port to bind to";
      };
    };
  
    unixSocket = with types; {
      path = mkOption {
        type = path;
        default = "/var/run/postgrey.sock";
        description = "Path of the unix socket";
      };
  
      mode = mkOption {
        type = string;
        default = "0777";
        description = "Mode of the unix socket";
      };
    };
  
  in {
  
  