1 { lib, mkYarnPackage, libsass, nodejs, python3, pkg-config, fetchFromGitHub
2 , fetchYarnDeps, nixosTests, vips, nodePackages }:
5 pinData = lib.importJSON ./pin.json;
9 nativeBuildInputs = [ pkg-config ];
10 buildInputs = [ libsass python3 ];
12 LIBSASS_EXT=auto yarn --offline run build
17 nativeBuildInputs = [ pkg-config nodePackages.semver ];
18 buildInputs = [ vips ];
20 yarn --offline run install
26 version = pinData.uiVersion;
28 src = fetchFromGitHub {
32 fetchSubmodules = true;
33 sha256 = pinData.uiSha256;
38 inherit src pkgConfig name version;
40 extraBuildInputs = [ libsass ];
42 packageJSON = ./package.json;
43 offlineCache = fetchYarnDeps {
44 yarnLock = src + "/yarn.lock";
45 sha256 = pinData.uiYarnDepsSha256;
49 export npm_config_nodedir=${nodejs}
53 # Yarn writes cache directories etc to $HOME.
54 export HOME=$PWD/yarn_home
56 ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
57 echo 'export const VERSION = "${version}";' > $PWD/deps/lemmy-ui/src/shared/version.ts
59 yarn --offline build:prod
64 cp -R ./deps/lemmy-ui/dist $out
65 cp -R ./node_modules $out
70 passthru.updateScript = ./update.sh;
71 passthru.tests.lemmy-ui = nixosTests.lemmy;
74 description = "Building a federated alternative to reddit in rust";
75 homepage = "https://join-lemmy.org/";
76 license = licenses.agpl3Only;
77 maintainers = with maintainers; [ happysalada billewanick ];
78 inherit (nodejs.meta) platforms;