-
-
Notifications
You must be signed in to change notification settings - Fork 294
Expand file tree
/
Copy pathnode-modules.nix
More file actions
56 lines (48 loc) · 1.17 KB
/
node-modules.nix
File metadata and controls
56 lines (48 loc) · 1.17 KB
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
50
51
52
53
54
55
56
{
pkgs,
lib,
...
}:
let
filteredSrc = lib.fileset.toSource {
root = ./.;
fileset = (
lib.fileset.intersection ./. (
lib.fileset.unions [
./package.json
./package-lock.json
./patches
]
)
);
};
in
pkgs.buildNpmPackage {
pname = "spacebar-server-ts-node_modules";
nodejs = pkgs.nodejs_24;
version = builtins.hashFile "sha256" ./package.json;
meta = with lib; {
description = "Node modules for the spacebar-server-ts package.";
homepage = "https://github.com/spacebarchat/server";
license = licenses.agpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ RorySys ];
};
src = filteredSrc;
npmDeps = pkgs.importNpmLock { npmRoot = filteredSrc; };
npmConfigHook = pkgs.importNpmLock.npmConfigHook;
dontNpmBuild = true;
makeCacheWritable = true;
nativeBuildInputs = with pkgs; [
(pkgs.python3.withPackages (ps: with ps; [ setuptools ]))
];
installPhase = ''
runHook preInstall
# Copy outputs
echo "Copying node_modules as $out"
cp -r node_modules $out
echo -n 'Disk usage: '
du -sh node_modules/
runHook postInstall
'';
}