anchor.diff:            fi
             ln -sfn ${configFile} ${cfg.dataDir}/postgresql.conf
   
  -          exec ${cfg.package}/bin/postgres -D ${cfg.dataDir} ${optionalString cfg.enableTCPIP "-i"}
  +          exec ${postgresql}/bin/postgres -D ${cfg.dataDir} ${optionalString cfg.enableTCPIP "-i"}
           '';
   
           serviceConfig.KeepAlive = true;
  
positive.code:         '';
        };
  
        extraConfig = mkOption {
          type = types.lines;
          default = "";
  
negative.code: 
  let
    cfg = config.services.postgresql;
  
    postgresqlAndPlugins = pg:
      if cfg.extraPlugins == [] then pg
      else pkgs.buildEnv {
        name = "postgresql-and-plugins-${(builtins.parseDrvName pg.name).version}";
        paths = [ pg pg.lib ] ++ cfg.extraPlugins;
        # We include /bin to ensure the $out/bin directory is created which is
        # needed because we'll be removing files from that directory in postBuild
        # below.
        pathsToLink = [ "/" "/bin" ];
        buildInputs = [ pkgs.makeWrapper ];
        postBuild = ''
          rm $out/bin/{pg_config,postgres,pg_ctl}
          cp --target-directory=$out/bin ${pg}/bin/{postgres,pg_config,pg_ctl}
          wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib
        '';
      };
  
    postgresql = postgresqlAndPlugins cfg.package;
  
    configFile = pkgs.writeText "postgresql.conf"
      ''
  