anchor.diff:          default = "";
           description = ''
             File name extension mappings.
  -          See <literal>man extmap.conf</literal> for more information.
  +          See <citerefentry><refentrytitle>extmap.conf</refentrytitle>
  +          <manvolnum>5</manvolnum></citerefentry>. for more information.
           '';
         };
   
       };
     };
   
  +  imports = (map (option:
  +    mkRemovedOptionModule [ "services" "netatalk" option ]
  +    "This option was removed in favor of `services.netatalk.settings`.") [
  +      "extraConfig"
  +      "homes"
  +      "volumes"
  +    ]);
  +
     config = mkIf cfg.enable {
  +
  +    services.netatalk.settings.Global = {
  +      "afp port" = toString cfg.port;
  +      "extmap file" = "${pkgs.writeText "extmap.conf" cfg.extmap}";
  +    };
   
       systemd.services.netatalk = {
         description = "Netatalk AFP fileserver for Macintosh clients";
  -      unitConfig.Documentation = "man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)";
  +      unitConfig.Documentation =
  +        "man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)";
         after = [ "network.target" "avahi-daemon.service" ];
         wantedBy = [ "multi-user.target" ];
   
  
positive.code:         description = "TCP port to be used for AFP.";
        };
  
        extraConfig = mkOption {
          type = types.lines;
          default = "";
          example = "uam list = uams_guest.so";
          description = ''
            Lines of configuration to add to the <literal>[Global]</literal> section.
            See <literal>man apf.conf</literal> for more information.
          '';
        };
  
        homes = {
          enable = mkOption {
            type = types.bool;
            default = false;
            description = "Enable sharing of the UNIX server user home directories.";
          };
  
          path = mkOption {
            type = types.str;
            default = "";
            example = "afp-data";
            description = "Share not the whole user home but this subdirectory path.";
          };
  
          basedirRegex = mkOption {
            example = "/home";
            type = types.str;
            description = "Regex which matches the parent directory of the user homes.";
          };
  
          extraConfig = mkOption {
            type = types.lines;
            default = "";
            description = ''
              Lines of configuration to add to the <literal>[Homes]</literal> section.
              See <literal>man apf.conf</literal> for more information.
            '';
           };
        };
  
        volumes = mkOption {
          default = { };
          type = types.attrsOf (types.attrsOf types.unspecified);
          description =
            ''
              Set of AFP volumes to export.
              See <literal>man apf.conf</literal> for more information.
            '';
          example = literalExample ''
            { srv =
               { path = "/srv";
                 "read only" = true;
                 "hosts allow" = "10.1.0.0/16 10.2.1.100 2001:0db8:1234::/48";
               };
            }
          '';
        };
  
  
negative.code:         Type = "forking";
          GuessMainPID = "no";
          PIDFile = "/run/lock/netatalk";
          ExecStart = "${pkgs.netatalk}/sbin/netatalk -F ${afpConfFile}";
          ExecReload = "${pkgs.coreutils}/bin/kill -HUP  $MAINPID";
          ExecStop = "${pkgs.coreutils}/bin/kill -TERM $MAINPID";
          Restart = "always";
          RestartSec = 1;
          StateDirectory = [ "netatalk/CNID" ];
        };
  
      };
  