about summary refs log tree commit diff
path: root/pkgs/build-support/agda/lib.nix
blob: 80a0974192bb34d188a1cc72f5b4ff55b3549a78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ lib }:
{
  /* Returns the Agda interface file to a given Agda file.
  *
  * Examples:
  * interfaceFile "Everything.agda" == "Everything.agdai"
  * interfaceFile "src/Everything.lagda.tex" == "src/Everything.agdai"
  */
  interfaceFile = agdaFile: lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex))?'' agdaFile) + "agdai";

  /* 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;
}