···19 };
20 idrisLibraries = [ ];
21};
22-in lspLibPkg.library
23```
2425The above results in a derivation with the installed library results (with sourcecode).
···3031# Assuming the previous example lives in `lsp-lib.nix`:
32let lspLib = callPackage ./lsp-lib.nix { };
033 lspPkg = idris2Packages.buildIdris {
34 ipkgName = "idris2-lsp";
35 src = fetchFromGitHub {
···38 rev = "main";
39 hash = "sha256-vQTzEltkx7uelDtXOHc6QRWZ4cSlhhm5ziOqWA+aujk=";
40 };
41- idrisLibraries = [(idris2Packages.idris2Api { }) (lspLib { })];
42 };
43in lspPkg.executable
44```
4546-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.
47-
···19 };
20 idrisLibraries = [ ];
21};
22+in lspLibPkg.library { withSource = true; }
23```
2425The above results in a derivation with the installed library results (with sourcecode).
···3031# Assuming the previous example lives in `lsp-lib.nix`:
32let lspLib = callPackage ./lsp-lib.nix { };
33+ inherit (idris2Packages) idris2Api;
34 lspPkg = idris2Packages.buildIdris {
35 ipkgName = "idris2-lsp";
36 src = fetchFromGitHub {
···39 rev = "main";
40 hash = "sha256-vQTzEltkx7uelDtXOHc6QRWZ4cSlhhm5ziOqWA+aujk=";
41 };
42+ idrisLibraries = [idris2Api lspLib];
43 };
44in lspPkg.executable
45```
4647+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.
0