anchor.diff:          description = "Maximum number of items to keep in slow log.";
         };
   
  -      extraConfig = mkOption {
  -        type = types.lines;
  -        default = "";
  -        description = "Extra configuration options for redis.conf.";
  +      settings = mkOption {
  +        type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
  +        default = {};
  +        description = ''
  +          Redis configuration. Refer to
  +          <link xlink:href="https://redis.io/topics/config"/>
  +          for details on supported values.
  +        '';
  +        example = literalExample ''
  +          {
  +            unixsocketperm = "700";
  +            loadmodule = [ "/path/to/my_module.so" "/path/to/other_module.so" ];
  +          }
  +        '';
         };
       };
   
  
positive.code:     (mkRemovedOptionModule [ "services" "redis" "dbFilename" ] "The redis module now uses /var/lib/redis/dump.rdb as database dump location.")
      (mkRemovedOptionModule [ "services" "redis" "appendOnlyFilename" ] "This option was never used.")
      (mkRemovedOptionModule [ "services" "redis" "pidFile" ] "This option was removed.")
    ];
  
    ###### interface
  
negative.code: 
      environment.systemPackages = [ cfg.package ];
  
      services.redis.settings = mkMerge [
        {
          port = cfg.port;
          daemonize = false;
          supervised = "systemd";
          loglevel = cfg.logLevel;
          logfile = cfg.logfile;
          syslog-enabled = cfg.syslog;
          databases = cfg.databases;
          save = map (d: "${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}") cfg.save;
          dbfilename = "dump.rdb";
          dir = "/var/lib/redis";
          appendOnly = cfg.appendOnly;
          appendfsync = cfg.appendFsync;
          slowlog-log-slower-than = cfg.slowLogLogSlowerThan;
          slowlog-max-len = cfg.slowLogMaxLen;
        }
        (mkIf (cfg.bind != null) { bind = cfg.bind; })
        (mkIf (cfg.unixSocket != null) { unixsocket = cfg.unixSocket; })
        (mkIf (cfg.slaveOf != null) { slaveof = "${cfg.slaveOf.ip} ${cfg.slaveOf.port}"; })
        (mkIf (cfg.masterAuth != null) { masterauth = cfg.masterAuth; })
        (mkIf (cfg.requirePass != null) { requirepass = cfg.requirePass; })
      ];
  
      systemd.services.redis = {
        description = "Redis Server";
  
  