build-support/agda: expose mkLibraryFile

This commit is contained in:
Naïm Favier 2024-07-04 09:48:13 +02:00
parent 00d80d1381
commit 4ef7bf78bb
No known key found for this signature in database
GPG Key ID: 95AFCE8211908325
2 changed files with 10 additions and 7 deletions

View File

@ -19,14 +19,17 @@ let
optionalString
;
mkLibraryFile = pkgs: let
pkgs' = if isList pkgs then pkgs else pkgs self;
in writeText "libraries" ''
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
'';
withPackages' = {
pkgs,
ghc ? ghcWithPackages (p: with p; [ ieee754 ])
}: let
pkgs' = if isList pkgs then pkgs else pkgs self;
library-file = writeText "libraries" ''
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
'';
library-file = mkLibraryFile pkgs;
pname = "agdaWithPackages";
version = Agda.version;
in runCommand "${pname}-${version}" {
@ -118,5 +121,5 @@ in
{
mkDerivation = args: stdenv.mkDerivation (args // defaults args);
inherit withPackages withPackages';
inherit mkLibraryFile withPackages withPackages';
}

View File

@ -7,9 +7,9 @@ let
inherit (callPackage ../build-support/agda {
inherit Agda self;
inherit (pkgs.haskellPackages) ghcWithPackages;
}) withPackages mkDerivation;
}) withPackages mkLibraryFile mkDerivation;
in {
inherit mkDerivation;
inherit mkLibraryFile mkDerivation;
lib = lib.extend (final: prev: import ../build-support/agda/lib.nix { lib = prev; });