agda.withPackages: allow installing Agda without GHC using ghc = null;

This commit is contained in:
Tsung-Ju Chiang 2025-05-28 15:15:28 +08:00
parent aeb017b583
commit 17501d776b
2 changed files with 3 additions and 1 deletions

View file

@ -121,6 +121,8 @@ agda.withPackages {
}
```
To install Agda without GHC, use `ghc = null;`.
## Writing Agda packages {#writing-agda-packages}
To write a nix derivation for an Agda library, first check that the library has a `*.agda-lib` file.

View file

@ -66,7 +66,7 @@ let
''
mkdir -p $out/bin
makeWrapper ${Agda.bin}/bin/agda $out/bin/agda \
--add-flags "--with-compiler=${ghc}/bin/ghc" \
${lib.optionalString (ghc != null) ''--add-flags "--with-compiler=${ghc}/bin/ghc"''} \
--add-flags "--library-file=${library-file}"
ln -s ${Agda.bin}/bin/agda-mode $out/bin/agda-mode
'';