diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-01-27 04:17:36 +0100 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-01-27 04:17:36 +0100 |
commit | 43545381393695f722344b085620937fa3367a8a (patch) | |
tree | e2b7bdf1f0d5453341a4619f8a63948c6e6b2f76 /pkgs/development/compilers/idris2/idris2-lsp.nix | |
parent | 4757f0e68df99bc7177c68dcc7c523e391d213cf (diff) | |
parent | 741c01dfc130418b134d48dfbb68f9462f853e32 (diff) |
Merge branch 'staging-next' into staging
Diffstat (limited to 'pkgs/development/compilers/idris2/idris2-lsp.nix')
-rw-r--r-- | pkgs/development/compilers/idris2/idris2-lsp.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/compilers/idris2/idris2-lsp.nix b/pkgs/development/compilers/idris2/idris2-lsp.nix new file mode 100644 index 0000000000000..d73f2d70d6d0c --- /dev/null +++ b/pkgs/development/compilers/idris2/idris2-lsp.nix @@ -0,0 +1,44 @@ +{ fetchFromGitHub, idris2Packages, makeWrapper }: + +let + globalLibraries = let + idrName = "idris2-${idris2Packages.idris2.version}"; + libSuffix = "lib/${idrName}"; + in [ + "\\$HOME/.nix-profile/lib/${idrName}" + "/run/current-system/sw/lib/${idrName}" + "${idris2Packages.idris2}/${idrName}" + ]; + globalLibrariesPath = builtins.concatStringsSep ":" globalLibraries; + + idris2Api = idris2Packages.idris2Api { }; + lspLib = (idris2Packages.buildIdris { + ipkgName = "lsp-lib"; + version = "2024-01-21"; + src = fetchFromGitHub { + owner = "idris-community"; + repo = "LSP-lib"; + rev = "03851daae0c0274a02d94663d8f53143a94640da"; + hash = "sha256-ICW9oOOP70hXneJFYInuPY68SZTDw10dSxSPTW4WwWM="; + }; + idrisLibraries = [ ]; + }).library { }; + + lspPkg = idris2Packages.buildIdris { + ipkgName = "idris2-lsp"; + version = "2024-01-21"; + src = fetchFromGitHub { + owner = "idris-community"; + repo = "idris2-lsp"; + rev = "a77ef2d563418925aa274fa29f06880dde43f4ec"; + hash = "sha256-zjfVfkpiQS9AdmTfq0hYRSelJq5Caa9VGTuFLtSvl5o="; + }; + idrisLibraries = [idris2Api lspLib]; + + buildInputs = [makeWrapper]; + postInstall = '' + wrapProgram $out/bin/idris2-lsp \ + --suffix IDRIS2_PACKAGE_PATH ':' "${globalLibrariesPath}" + ''; + }; +in lspPkg.executable |