1 { lib, mkYarnPackage, libsass, nodejs, python3, pkg-config
2 , fetchFromGitHub, fetchYarnDeps, nixosTests }:
5 pinData = lib.importJSON ./pin.json;
9 nativeBuildInputs = [ pkg-config ];
10 buildInputs = [ libsass python3 ];
12 LIBSASS_EXT=auto yarn --offline run build
19 version = pinData.version;
21 src = fetchFromGitHub {
25 fetchSubmodules = true;
26 sha256 = pinData.uiSha256;
29 patches = [ ./disable-sharp.patch ];
32 inherit src pkgConfig name version patches;
34 extraBuildInputs = [ libsass ];
36 packageJSON = ./package.json;
37 offlineCache = fetchYarnDeps {
38 yarnLock = src + "/yarn.lock";
39 sha256 = pinData.uiYarnDepsSha256;
43 export npm_config_nodedir=${nodejs}
47 # Yarn writes cache directories etc to $HOME.
48 export HOME=$PWD/yarn_home
50 ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
52 yarn --offline build:prod
57 cp -R ./deps/lemmy-ui/dist $out
58 cp -R ./node_modules $out
63 passthru.updateScript = ./update.sh;
64 passthru.tests.lemmy-ui = nixosTests.lemmy;
67 description = "Building a federated alternative to reddit in rust";
68 homepage = "https://join-lemmy.org/";
69 license = licenses.agpl3Only;
70 maintainers = with maintainers; [ happysalada billewanick ];
71 inherit (nodejs.meta) platforms;