mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
build: 🏗️ Add Nix build
Some checks failed
Some checks failed
This commit is contained in:
parent
40bb2cc7dc
commit
5fdf31a717
6 changed files with 11118 additions and 0 deletions
65
nix/package.nix
Normal file
65
nix/package.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
pnpm,
|
||||
bun,
|
||||
nodejs,
|
||||
makeWrapper,
|
||||
...
|
||||
}: let
|
||||
packageJson = builtins.fromJSON (builtins.readFile ../package.json);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = packageJson.name;
|
||||
version = packageJson.version;
|
||||
|
||||
src = ../.;
|
||||
|
||||
pnpmDeps = pnpm.fetchDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
hash = "sha256-NFppXHekesdV9Qg81I7fNjLPTvb3vBz7557a1AGlyOI=";
|
||||
};
|
||||
|
||||
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"];
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue