git.iko.soy/typeable/nixpkgs
on master help sign in
build-support/agda: Make includePaths configurable
58ec6ceManuel Bärenz
pkgs/build-support/agda/default.nix+3−1
@@ -49,6 +49,7 @@ let
49 , meta
49 , meta
50 , buildInputs ? []
50 , buildInputs ? []
51 , everythingFile ? "./Everything.agda"
51 , everythingFile ? "./Everything.agda"
52+ , includePaths ? []
52 , libraryName ? pname
53 , libraryName ? pname
53 , libraryFile ? "${libraryName}.agda-lib"
54 , libraryFile ? "${libraryName}.agda-lib"
54 , buildPhase ? null
55 , buildPhase ? null
@@ -57,6 +58,7 @@ let
57 , ...
58 , ...
58 }: let
59 }: let
59 agdaWithArgs = withPackages (builtins.filter (p: p ? isAgdaDerivation) buildInputs);
60 agdaWithArgs = withPackages (builtins.filter (p: p ? isAgdaDerivation) buildInputs);
61+ includePathArgs = concatMapStrings (path: "-i" + path + " ") (includePaths ++ [(dirOf everythingFile)]);
60 in
62 in
61 {
63 {
62 inherit libraryName libraryFile;
64 inherit libraryName libraryFile;
@@ -67,7 +69,7 @@ let
67
69
68 buildPhase = if buildPhase != null then buildPhase else ''
70 buildPhase = if buildPhase != null then buildPhase else ''
69 runHook preBuild
71 runHook preBuild
70− agda -i ${dirOf everythingFile} ${everythingFile}
72+ agda ${includePathArgs} ${everythingFile}
71 runHook postBuild
73 runHook postBuild
72 '';
74 '';
73
75