frontend/nix/package.nix

66 lines
1.3 KiB
Nix
Raw Normal View History

{
lib,
stdenv,
pnpm,
bun,
nodejs,
makeWrapper,
...
}: let
packageJson = builtins.fromJSON (builtins.readFile ../package.json);
in
stdenv.mkDerivation (finalAttrs: {
pname = "versia-fe";
version = packageJson.version;
src = ../.;
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
2025-05-28 20:58:07 +02:00
hash = "sha256-coO6eNC7x4I6PiFsQYJKb86qYUvtcqXrO3MzvnPKNXI=";
};
nativeBuildInputs = [
pnpm
pnpm.configHook
bun
nodejs
makeWrapper
];
buildPhase = ''
runHook preBuild
# Disable telemetry, as it crashes the build
export NUXT_TELEMETRY_DISABLED=1
bun run emojis:generate
bun run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r .output/public $out/${finalAttrs.pname}
runHook postInstall
'';
meta = with lib; {
description = packageJson.description;
license = licenses.agpl3Only;
maintainers = [
{
name = "CPlusPatch";
email = "contact@cpluspatch.com";
github = "CPlusPatch";
githubId = 42910258;
matrix = "@jesse:cpluspatch.dev";
}
];
platforms = ["x86_64-linux" "aarch64-linux"];
};
})