anchor.diff:    , version
     , ipkgName ? name
     , extraBuildInputs ? []
  +  , idrisBuildOptions ? []
  +  , idrisTestOptions ? []
  +  , idrisInstallOptions ? []
  +  , idrisDocOptions ? []
     , ...
     }@attrs:
   let
  
positive.code:   installPhase = ''
      runHook preInstall
  
      idris --install ${ipkgName}.ipkg --ibcsubdir $out/libs
  
      IDRIS_DOC_PATH=$out/doc idris --installdoc ${ipkgName}.ipkg || true
  
      # If the ipkg file defines an executable, install that
      executable=$(grep -Po '^executable = \K.*' ${ipkgName}.ipkg || true)
  
negative.code: 
    buildPhase = ''
      runHook preBuild
      idris --build ${ipkgName}.ipkg ${lib.escapeShellArgs idrisBuildOptions}
      runHook postBuild
    '';
  
    checkPhase = ''
      runHook preCheck
      if grep -q tests ${ipkgName}.ipkg; then
        idris --testpkg ${ipkgName}.ipkg ${lib.escapeShellArgs idrisTestOptions}
      fi
      runHook postCheck
    '';
  