-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (39 loc) · 1.43 KB
/
flake.nix
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
description = "A flake for the angular-language-server";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
nodejs = pkgs.nodejs;
makeWrapper = pkgs.makeWrapper;
in
{
packages = let
version = let packageJson = with builtins; fromJSON (readFile ./package.json);
in builtins.replaceStrings [ "^" "~" ] [ "" "" ]
(packageJson.dependencies."@angular/language-server");
in {
angular-language-server = pkgs.mkYarnPackage rec {
pname = "angular-language-server";
version = "18.0";
system = "${system}";
src = ./.;
inherit nodejs;
nativeBuildInputs = with pkgs; [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r $node_modules $out
cp $src/index.js $out/bin/${pname}-unwrapped
chmod a+x $out/bin/${pname}-unwrapped
makeWrapper $out/bin/${pname}-unwrapped $out/bin/${pname} \
--add-flags "--stdio --ngProbeLocations $out/node_modules --tsProbeLocations $out/node-modules"
runHook postInstall
'';
dontFixup = true;
doDist = false;
};
};
});
}