add mkNteDerivation helper function

This commit is contained in:
jacekpoz 2024-09-12 21:45:32 +02:00
parent a022e735b0
commit 66b86d7c25
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 20 additions and 1 deletions

View file

@ -13,8 +13,9 @@
functions = forEachSystem ( functions = forEachSystem (
system: let system: let
pkgs = pkgsForEach.${system}; pkgs = pkgsForEach.${system};
in { in rec {
engine = import ./engine.nix pkgs; engine = import ./engine.nix pkgs;
mkNteDerivation = import ./nte-drv.nix pkgs engine;
} }
); );

18
nte-drv.nix Normal file
View file

@ -0,0 +1,18 @@
pkgs: engine: {
name,
version,
src,
extraArgs ? {},
entries ? [],
templates ? [],
}: pkgs.stdenv.mkDerivation {
inherit name version src;
buildPhase = /*sh*/''
runHook preBuild
${engine src {inherit extraArgs entries templates;}}
runHook postBuild
'';
}