about summary refs log tree commit diff
path: root/pkgs/by-name/st/starpls-bin/package.nix
blob: c6106ebd61266e5e723c141054373c5c15ec7471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, fetchurl }:

stdenv.mkDerivation (finalAttrs: {
  pname = "starpls-bin";
  version = "0.1.14";

  src = {
    x86_64-linux = fetchurl {
      url = "https://github.com/withered-magic/starpls/releases/download/v${finalAttrs.version}/starpls-linux-amd64";
      hash = "sha256-PYU+Jv3uaJqJKw6zSNOPl+NlIQgfm38cOrRqTdNXY+8=";
    };
    aarch64-darwin = fetchurl {
      url = "https://github.com/withered-magic/starpls/releases/download/v${finalAttrs.version}/starpls-darwin-arm64";
      hash = "sha256-9d1ybebguEUJu2PvMcToQEd8M4ajRrQUvBZqS6o0sbw=";
    };
  }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");

  dontUnpack = true;
  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    install -D $src $out/bin/starpls
  '';

  meta = with lib; {
    homepage = "https://github.com/withered-magic/starpls";
    description = "A language server for Starlark";
    license = licenses.asl20;
    platforms = [ "aarch64-darwin" "x86_64-linux" ];
    maintainers = with maintainers; [ aaronjheng ];
    mainProgram = "starpls";
  };
})