2021-02-05 17:12:51 +00:00
|
|
|
{ lib }:
|
|
|
|
{
|
|
|
|
/* Returns the Agda interface file to a given Agda file.
|
|
|
|
*
|
2024-04-21 15:54:59 +00:00
|
|
|
* The resulting path may not be normalized.
|
|
|
|
*
|
2021-02-05 17:12:51 +00:00
|
|
|
* Examples:
|
2024-04-21 15:54:59 +00:00
|
|
|
* interfaceFile pkgs.agda.version "./Everything.agda" == "_build/2.6.4.3/agda/./Everything.agdai"
|
|
|
|
* interfaceFile pkgs.agda.version "src/Everything.lagda.tex" == "_build/2.6.4.3/agda/src/Everything.agdai"
|
2021-02-05 17:12:51 +00:00
|
|
|
*/
|
2024-04-21 15:54:59 +00:00
|
|
|
interfaceFile = agdaVersion: agdaFile: "_build/" + agdaVersion + "/agda/" + lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile) + "agdai";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
/* Takes an arbitrary derivation and says whether it is an agda library package
|
|
|
|
* that is not marked as broken.
|
|
|
|
*/
|
|
|
|
isUnbrokenAgdaPackage = pkg: pkg.isAgdaDerivation or false && !pkg.meta.broken;
|
2021-02-05 17:12:51 +00:00
|
|
|
}
|