diff options
author | Fabián Heredia Montiel | 2024-06-25 00:52:06 -0600 |
---|---|---|
committer | GitHub | 2024-06-25 00:52:06 -0600 |
commit | 3ff3888250282c7ea01938972435b4ab6033f5d7 (patch) | |
tree | a623123d47d6d39b654c048f5661f6016a29384f /doc | |
parent | ddbfbc80bbeaca549ed2404f3c04ed9808a0b540 (diff) | |
parent | 77a37cde203873ac8be0ee8cfdb6770e5dfd3ecf (diff) |
Merge pull request #322006 from mattpolzin/buildIdris-better-lib-ergonomics
idris2Packages.buildIdris: better lib ergonomics
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/idris2.section.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/languages-frameworks/idris2.section.md b/doc/languages-frameworks/idris2.section.md index f1f0277cc609..3ea9b4f988f7 100644 --- a/doc/languages-frameworks/idris2.section.md +++ b/doc/languages-frameworks/idris2.section.md @@ -19,7 +19,7 @@ let lspLibPkg = idris2Packages.buildIdris { }; idrisLibraries = [ ]; }; -in lspLibPkg.library +in lspLibPkg.library { withSource = true; } ``` The above results in a derivation with the installed library results (with sourcecode). @@ -30,6 +30,7 @@ A slightly more involved example of a fully packaged executable would be the [`i # Assuming the previous example lives in `lsp-lib.nix`: let lspLib = callPackage ./lsp-lib.nix { }; + inherit (idris2Packages) idris2Api; lspPkg = idris2Packages.buildIdris { ipkgName = "idris2-lsp"; src = fetchFromGitHub { @@ -38,10 +39,9 @@ let lspLib = callPackage ./lsp-lib.nix { }; rev = "main"; hash = "sha256-vQTzEltkx7uelDtXOHc6QRWZ4cSlhhm5ziOqWA+aujk="; }; - idrisLibraries = [(idris2Packages.idris2Api { }) (lspLib { })]; + idrisLibraries = [idris2Api lspLib]; }; in lspPkg.executable ``` -The above uses the default value of `withSource = false` for both of the two required Idris libraries that the `idris2-lsp` executable depends on. `idris2Api` in the above derivation comes built in with `idris2Packages`. This library exposes many of the otherwise internal APIs of the Idris2 compiler. - +The above uses the default value of `withSource = false` for the `idris2Api` but could be modified to include that library's source by passing `(idris2Api { withSource = true; })` to `idrisLibraries` instead. `idris2Api` in the above derivation comes built in with `idris2Packages`. This library exposes many of the otherwise internal APIs of the Idris2 compiler. |