blob: b3b267d2f72287589a1070b6139b23ad751b21bd (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
{ lib
, stdenvNoCC
, libsass
, nodejs
, python3
, pkg-config
, pnpm_9
, fetchFromGitHub
, nixosTests
, vips
, nodePackages
}:
let
pinData = lib.importJSON ./pin.json;
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "lemmy-ui";
version = pinData.uiVersion;
src = with finalAttrs; fetchFromGitHub {
owner = "LemmyNet";
repo = pname;
rev = version;
fetchSubmodules = true;
hash = pinData.uiHash;
};
nativeBuildInputs = [
nodejs
pnpm_9.configHook
];
buildInputs = [libsass vips ];
extraBuildInputs = [ libsass ];
pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname version src;
hash = pinData.uiPNPMDepsHash;
};
buildPhase = ''
runHook preBuild
pnpm build:prod
runHook postBuild
'';
# installPhase = ''
# runHook preInstall
# mkdir -p $out/{bin,lib/${finalAttrs.pname}}
# mv {dist,node_modules} $out/lib/${finalAttrs.pname}
# runHook postInstall
# '';
preInstall = ''
mkdir $out
cp -R ./dist $out
cp -R ./node_modules $out
'';
distPhase = "true";
passthru.updateScript = ./update.py;
passthru.tests.lemmy-ui = nixosTests.lemmy;
passthru.commit_sha = finalAttrs.src.rev;
meta = with lib; {
description = "Building a federated alternative to reddit in rust";
homepage = "https://join-lemmy.org/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ happysalada billewanick georgyo ];
inherit (nodejs.meta) platforms;
};
})
|