1 { lib, mkYarnPackage, libsass, nodejs, python3, pkg-config, fetchFromGitHub
2 , fetchYarnDeps, nixosTests, vips, nodePackages, lemmy-translations
8 nativeBuildInputs = [ pkg-config ];
9 buildInputs = [ libsass python3 ];
11 LIBSASS_EXT=auto yarn --offline run build
16 nativeBuildInputs = [ pkg-config nodePackages.semver ];
17 buildInputs = [ vips ];
19 yarn --offline run install
31 inherit src pkgConfig name version;
33 extraBuildInputs = [ libsass ];
35 packageJSON = ./package.json;
36 offlineCache = fetchYarnDeps {
37 yarnLock = src + "/yarn.lock";
38 sha256 = "sha256-EZSTYdUhb1+8GIx9UnOtImcg8ABA6RPqTrelZa3QD84=";
42 export npm_config_nodedir=${nodejs}
46 # Yarn writes cache directories etc to $HOME.
47 export HOME=$PWD/yarn_home
48 rm -rf node_modules/lemmy-js-client
49 ln -sf ${lemmy-js-client}/libexec/lemmy-js-client/node_modules/lemmy-js-client node_modules/lemmy-js-client
51 ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
52 echo 'export const VERSION = "${version}";' > $PWD/deps/lemmy-ui/src/shared/version.ts
54 ln -sf ${lemmy-translations} deps/lemmy-ui/lemmy-translations
56 yarn --offline build:prod
61 cp -R ./deps/lemmy-ui/dist $out
62 cp -R ./node_modules $out
67 passthru.updateScript = ./update.sh;
68 passthru.tests.lemmy-ui = nixosTests.lemmy;
71 description = "Building a federated alternative to reddit in rust";
72 homepage = "https://join-lemmy.org/";
73 license = licenses.agpl3Only;
74 maintainers = with maintainers; [ happysalada billewanick ];
75 inherit (nodejs.meta) platforms;