anchor.diff:        chmod -R +w ${userDir}
       fi
   
  -    RUNDIR=\$(mktemp -td nethack.\$USER.XXXXX)
  +    RUNDIR=\$(mktemp -d)
   
       cleanup() {
         rm -rf \$RUNDIR
  
positive.code:     else abort "Unknown platform for NetHack";
    unixHint =
      if stdenv.isLinux then "linux"
      # We probably want something different for Darwin
      else "unix";
    userDir = "~/.config/nethack";
  
negative.code: 
    makeFlags = [ "PREFIX=$(out)" ];
  
    patchPhase = ''
      sed -e '/^ *cd /d' -i sys/unix/nethack.sh
      sed \
        -e 's/^YACC *=.*/YACC = bison -y/' \
        -e 's/^LEX *=.*/LEX = flex/' \
        -i sys/unix/Makefile.utl
      sed \
        -e 's,/bin/gzip,${gzip}/bin/gzip,g' \
        -e 's,^WINTTYLIB=.*,WINTTYLIB=-lncurses,' \
        -i sys/unix/hints/linux
      sed \
        -e 's,^CC=.*$,CC=cc,' \
        -e 's,^HACKDIR=.*$,HACKDIR=\$(PREFIX)/games/lib/\$(GAME)dir,' \
        -e 's,^SHELLDIR=.*$,SHELLDIR=\$(PREFIX)/games,' \
        -i sys/unix/hints/macosx10.10
      sed -e '/define CHDIR/d' -i include/config.h
    '';
  
    configurePhase = ''
      cd sys/${platform}
      ${lib.optionalString (platform == "unix") ''
        sh setup.sh hints/${unixHint}
      ''}
      cd ../..
    '';
  
    postInstall = ''
  