mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
This fixes `agda.tests.allPackages`, which currently fails when aliases are enabled because `agdaPackages.generic` throws an evaluation error.
31 lines
827 B
Nix
31 lines
827 B
Nix
{ lib }:
|
|
{
|
|
/*
|
|
Returns the Agda interface file to a given Agda file.
|
|
*
|
|
* The resulting path may not be normalized.
|
|
*
|
|
* Examples:
|
|
* interfaceFile pkgs.agda.version "./Foo.agda" == "_build/AGDA_VERSION/agda/./Foo.agdai"
|
|
* interfaceFile pkgs.agda.version "src/Foo.lagda.tex" == "_build/AGDA_VERSION/agda/src/Foo.agdai"
|
|
*/
|
|
interfaceFile =
|
|
agdaVersion: agdaFile:
|
|
"_build/"
|
|
+ agdaVersion
|
|
+ "/agda/"
|
|
+ lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile)
|
|
+ "agdai";
|
|
|
|
/*
|
|
Takes an arbitrary derivation and says whether it is an agda library package
|
|
* that is not marked as broken.
|
|
*/
|
|
isUnbrokenAgdaPackage =
|
|
pkg:
|
|
let
|
|
r = builtins.tryEval (pkg.isAgdaDerivation or false && !pkg.meta.broken);
|
|
in
|
|
r.success && r.value;
|
|
}
|