anchor.diff:      };
     }) // (removeAttrs attrs ["makeFlags"]));
   
  +  libutil = netBSDDerivation {
  +    path = "lib/libutil";
  +    version = "8.0";
  +    sha256 = "077syyxd303m4x7avs5nxzk4c9n13d5lyk5aicsacqjvx79qrk3i";
  +    extraPaths = [
  +      (fetchNetBSD "common/lib/libutil" "8.0" "0q3ixrf36lip1dx0gafs0a03qfs5cs7n0myqq7af4jpjd6kh1831")
  +    ];
  +  };
  +
  +  libc = netBSDDerivation {
  +    path = "lib/libc";
  +    version = "8.0";
  +    sha256 = "0lgbc58qgn8kwm3l011x1ml1kgcf7jsgq7hbf0hxhlbvxq5bljl3";
  +    extraPaths = [
  +      (fetchNetBSD "common/lib/libc" "8.0" "1kbhj0vxixvdy9fvsr5y70ri4mlkmim1v9m98sqjlzc1vdiqfqc8")
  +    ];
  +  };
  +
  +  make = netBSDDerivation {
  +    path = "usr.bin/make";
  +    sha256 = "103643qs3w5kiahir6cca2rkm5ink81qbg071qyzk63qvspfq10c";
  +    version = "8.0";
  +    postPatch = ''
  +      # make needs this to pick up our sys make files
  +      export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\""
  +
  +      substituteInPlace $NETBSDSRCDIR/share/mk/bsd.prog.mk \
  +        --replace '-Wl,-dynamic-linker=''${_SHLINKER}' "" \
  +        --replace '-Wl,-rpath,''${SHLIBDIR}' ""
  +      substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \
  +        --replace '_INSTRANLIB=''${empty(PRESERVE):?-a "''${RANLIB} -t":}' '_INSTRANLIB='
  +      substituteInPlace $NETBSDSRCDIR/share/mk/bsd.kinc.mk \
  +        --replace /bin/rm rm
  +    '' + lib.optionalString stdenv.isDarwin ''
  +      substituteInPlace $NETBSDSRCDIR/share/mk/bsd.sys.mk \
  +        --replace '-Wl,--fatal-warnings' "" \
  +        --replace '-Wl,--warn-shared-textrel' ""
  +      substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \
  +        --replace '-Wl,-soname,''${_LIB}.so.''${SHLIB_SOVERSION}' "" \
  +        --replace '-Wl,--whole-archive' "" \
  +        --replace '-Wl,--no-whole-archive' "" \
  +        --replace '-Wl,--warn-shared-textrel' "" \
  +        --replace '-Wl,-Map=''${_LIB}.so.''${SHLIB_SOVERSION}.map' "" \
  +        --replace '-Wl,-rpath,''${SHLIBDIR}' ""
  +    '';
  +    postInstall = ''
  +      make -C $NETBSDSRCDIR/share/mk FILESDIR=/share/mk install
  +    '';
  +    extraPaths = [
  +      (fetchNetBSD "share/mk" "8.0" "033q4w3rmvwznz6m7fn9xcf13chyhwwl8ijj3a9mrn80fkwm55qs")
  +    ];
  +  };
  +
  +  libcurses = netBSDDerivation {
  +    path = "lib/libcurses";
  +    version = "8.0";
  +    sha256 = "0azhzh1910v24dqx45zmh4z4dl63fgsykajrbikx5xfvvmkcq7xs";
  +    buildInputs = [ nbPackages.libterminfo ];
  +    makeFlags = [ "INCSDIR=/include" ];
  +    NIX_CFLAGS_COMPILE = [
  +      "-D__scanflike(a,b)="
  +      "-D__va_list=va_list"
  +      "-D__warn_references(a,b)="
  +    ] ++ lib.optional stdenv.isDarwin "-D__strong_alias(a,b)=";
  +    propagatedBuildInputs = [ nbPackages.compat ];
  +    MKDOC = "no"; # missing vfontedpr
  +    postPatch = ''
  +      substituteInPlace printw.c \
  +        --replace "funopen2(win, NULL, winwrite, NULL, NULL, NULL)" NULL \
  +        --replace "__strong_alias(vwprintw, vw_printw)" 'extern int vwprintw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_printw")));'
  +      substituteInPlace scanw.c \
  +        --replace "__strong_alias(vwscanw, vw_scanw)" 'extern int vwscanw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_scanw")));'
  +    '';
  +  };
  +
  +  libedit = netBSDDerivation {
  +    path = "lib/libedit";
  +    buildInputs = [ nbPackages.libterminfo libcurses ];
  +    propagatedBuildInputs = [ nbPackages.compat ];
  +    makeFlags = [ "INCSDIR=/include" ];
  +    postPatch = ''
  +      sed -i '1i #undef bool_t' el.h
  +      substituteInPlace config.h \
  +        --replace "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" ""
  +    '';
  +    NIX_CFLAGS_COMPILE = [
  +      "-D__noinline="
  +      "-D__scanflike(a,b)="
  +      "-D__va_list=va_list"
  +    ];
  +    version = "8.0";
  +    sha256 = "0pmqh2mkfp70bwchiwyrkdyq9jcihx12g1awd6alqi9bpr3f9xmd";
  +  };
  +
     nbPackages = rec {
   
     ##
  
positive.code:       install -D $NETBSDSRCDIR/include/utmpx.h $out/include/utmpx.h
        install -D $NETBSDSRCDIR/include/tzfile.h $out/include/tzfile.h
        install -D $NETBSDSRCDIR/sys/sys/tree.h $out/include/sys/tree.h
  
        mkdir -p $out/lib/pkgconfig
        substitute ${./libbsd-overlay.pc} $out/lib/pkgconfig/libbsd-overlay.pc \
          --subst-var-by out $out \
  
negative.code: 
      '';
      postInstall = ''
        make -C $NETBSDSRCDIR/share/terminfo BINDIR=/share
        make -C $NETBSDSRCDIR/share/terminfo BINDIR=/share install
      '';
      extraPaths = [
        (fetchNetBSD "share/terminfo" "8.0" "18db0fk1dw691vk6lsm6dksm4cf08g8kdm0gc4052ysdagg2m6sm")
      ];
    };
  
    nbperf = netBSDDerivation {
  