anchor.diff:  
         dataDir = mkOption {
           type = types.str;
  -        default = defaultDataDir;
  +        default = if versionAtLeast config.system.stateVersion "17.09"
  +                  then "/var/lib/ipfs"
  +                  else "/var/lib/ipfs/.ipfs";
           description = "The data dir for IPFS";
         };
   
  
positive.code:     (optionalString (cfg.defaultMode == "norouting") "--routing=none")
    ] ++ cfg.extraFlags);
  
    defaultDataDir = if versionAtLeast config.system.stateVersion "17.09" then
      "/var/lib/ipfs" else
      "/var/lib/ipfs/.ipfs";
  
    # Wrapping the ipfs binary with the environment variable IPFS_PATH set to dataDir because we can't set it in the user environment
    wrapped = runCommand "ipfs" { buildInputs = [ makeWrapper ]; preferLocalBuild = true; } ''
      mkdir -p "$out/bin"
      makeWrapper "${ipfs}/bin/ipfs" "$out/bin/ipfs" \
        --set IPFS_PATH ${cfg.dataDir} \
        --prefix PATH : /run/wrappers/bin
    '';
  
  
    commonEnv = {
      environment.IPFS_PATH = cfg.dataDir;
      path = [ wrapped ];
      serviceConfig.User = cfg.user;
      serviceConfig.Group = cfg.group;
    };
  
    baseService = recursiveUpdate commonEnv {
      wants = [ "ipfs-init.service" ];
      preStart = optionalString cfg.autoMount ''
        ipfs --local config Mounts.FuseAllowOther --json true
        ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
        ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir}
      '' + concatStringsSep "\n" (collect
            isString
            (mapAttrsRecursive
              (path: value:
              # Using heredoc below so that the value is never improperly quoted
              ''
                read value <<EOF
                ${builtins.toJSON value}
                EOF
                ipfs --local config --json "${concatStringsSep "." path}" "$value"
              '')
              ({ Addresses.API = cfg.apiAddress;
                 Addresses.Gateway = cfg.gatewayAddress;
                 Addresses.Swarm = cfg.swarmAddress;
              } //
              cfg.extraConfig))
          );
      serviceConfig = {
        ExecStart = "${wrapped}/bin/ipfs daemon ${ipfsFlags}";
        Restart = "on-failure";
        RestartSec = 1;
      } // optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; };
    };
  in {
  
    ###### interface
  
negative.code:       "d '${cfg.ipnsMountDir}' - ${cfg.user} ${cfg.group} - -"
      ];
  
      systemd.services.ipfs-init = {
        description = "IPFS Initializer";
  
        environment.IPFS_PATH = cfg.dataDir;
  
        path = [ pkgs.ipfs ];
  
        script = ''
          if [[ ! -f ${cfg.dataDir}/config ]]; then
  