lemmy-ui: add static assets folder to out
This commit is contained in:
parent
82155ff501
commit
5e7aab5982
|
@ -4,7 +4,6 @@
|
||||||
, nodejs
|
, nodejs
|
||||||
, python3
|
, python3
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, writeShellScriptBin
|
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -22,53 +21,53 @@ let
|
||||||
|
|
||||||
name = "lemmy-ui";
|
name = "lemmy-ui";
|
||||||
version = "0.12.2";
|
version = "0.12.2";
|
||||||
unwrapped = mkYarnPackage {
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "LemmyNet";
|
|
||||||
repo = name;
|
|
||||||
rev = version;
|
|
||||||
fetchSubmodules = true;
|
|
||||||
sha256 = "sha256-iFLJqUnz4m9/JTSaJSUugzY5KkiKtH0sMYY4ALm2Ebk=";
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit pkgConfig name version;
|
|
||||||
|
|
||||||
extraBuildInputs = [ libsass ];
|
|
||||||
|
|
||||||
yarnNix = ./yarn.nix;
|
|
||||||
|
|
||||||
# Fails mysteriously on source/package.json
|
|
||||||
# Upstream package.json is missing a newline at the end
|
|
||||||
packageJSON = ./package.json;
|
|
||||||
|
|
||||||
yarnPreBuild = ''
|
|
||||||
export npm_config_nodedir=${nodejs}
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
# Yarn writes cache directories etc to $HOME.
|
|
||||||
export HOME=$PWD/yarn_home
|
|
||||||
|
|
||||||
ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
|
|
||||||
|
|
||||||
yarn --offline build:prod
|
|
||||||
'';
|
|
||||||
|
|
||||||
distPhase = "true";
|
|
||||||
|
|
||||||
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 ];
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
(writeShellScriptBin "lemmy-ui" ''
|
mkYarnPackage {
|
||||||
${nodejs}/bin/node ${unwrapped}/libexec/lemmy-ui/node_modules/lemmy-ui/dist/js/server.js
|
|
||||||
'').overrideAttrs (oldAttrs: {
|
src = fetchFromGitHub {
|
||||||
passthru = { inherit unwrapped; };
|
owner = "LemmyNet";
|
||||||
})
|
repo = name;
|
||||||
|
rev = version;
|
||||||
|
fetchSubmodules = true;
|
||||||
|
sha256 = "sha256-iFLJqUnz4m9/JTSaJSUugzY5KkiKtH0sMYY4ALm2Ebk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit pkgConfig name version;
|
||||||
|
|
||||||
|
extraBuildInputs = [ libsass ];
|
||||||
|
|
||||||
|
yarnNix = ./yarn.nix;
|
||||||
|
|
||||||
|
# Fails mysteriously on source/package.json
|
||||||
|
# Upstream package.json is missing a newline at the end
|
||||||
|
packageJSON = ./package.json;
|
||||||
|
|
||||||
|
yarnPreBuild = ''
|
||||||
|
export npm_config_nodedir=${nodejs}
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
# Yarn writes cache directories etc to $HOME.
|
||||||
|
export HOME=$PWD/yarn_home
|
||||||
|
|
||||||
|
ln -sf $PWD/node_modules $PWD/deps/lemmy-ui/
|
||||||
|
|
||||||
|
yarn --offline build:prod
|
||||||
|
'';
|
||||||
|
|
||||||
|
preInstall = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -R ./deps/lemmy-ui/dist/assets $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
distPhase = "true";
|
||||||
|
|
||||||
|
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 ];
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue