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.version;
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 echo "export const VERSION = '${version}';" > "src/shared/version.ts"
53 export npm_config_nodedir=${nodejs}
57 # Yarn writes cache directories etc to $HOME.
58 export HOME=$PWD/yarn_home
60 ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
62 yarn --offline build:prod
67 cp -R ./deps/lemmy-ui/dist $out
68 cp -R ./node_modules $out
73 passthru.updateScript = ./update.sh;
74 passthru.tests.lemmy-ui = nixosTests.lemmy;
77 description = "Building a federated alternative to reddit in rust";
78 homepage = "https://join-lemmy.org/";
79 license = licenses.agpl3Only;
80 maintainers = with maintainers; [ happysalada billewanick ];
81 inherit (nodejs.meta) platforms;