full ci-cd pipeline built on bun2nix

This commit is contained in:
polwex 2026-04-19 00:54:56 +07:00
parent 7cebe39a14
commit f81d5604ae
11 changed files with 1528 additions and 2 deletions

54
nix/package.nix Normal file
View file

@ -0,0 +1,54 @@
{ lib
, stdenvNoCC
, bun
, bun2nix
, makeWrapper
}:
let
packageJson = lib.importJSON ../package.json;
in
stdenvNoCC.mkDerivation {
pname = "leo-ed";
version = packageJson.version;
src = lib.cleanSource ../.;
bunDeps = bun2nix.fetchBunDeps {
bunNix = ../bun.nix;
};
nativeBuildInputs = [
bun2nix.hook
bun
makeWrapper
];
dontRunLifecycleScripts = true;
dontUseBunInstall = true;
buildPhase = ''
runHook preBuild
bun run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/leo-ed $out/bin
cp -r build/. $out/share/leo-ed/
makeWrapper ${lib.getExe bun} $out/bin/leo-ed \
--run "cd $out/share/leo-ed" \
--add-flags "$out/share/leo-ed/server.js"
runHook postInstall
'';
meta = {
description = "Typing practice app with passkey auth";
homepage = "https://example.invalid";
mainProgram = "leo-ed";
platforms = lib.platforms.linux;
};
}