add pack nix build target

This commit is contained in:
2025-11-18 18:31:58 +01:00
parent f588ea1e3f
commit 67ca761fe7

View File

@@ -13,19 +13,20 @@
envSetup = '' envSetup = ''
unset SOURCE_DATE_EPOCH unset SOURCE_DATE_EPOCH
''; '';
build = target: pkgs.stdenv.mkDerivation { build_with_target = target: buildOutput: pkgs.stdenv.mkDerivation {
inherit buildInputs target; inherit buildInputs target buildOutput;
name = name + "-" + target; name = name + "-" + target;
src = ./.; src = ./.;
buildPhase = '' buildPhase = ''
${envSetup} ${envSetup}
make target/$target make $target
''; '';
installPhase = '' installPhase = ''
mkdir $out mkdir $out
cp target/$target $out cp -R $buildOutput $out
''; '';
}; };
build = target: build_with_target ("target/" + target) ("target/" + target);
in in
{ {
devShell = with pkgs; mkShell { devShell = with pkgs; mkShell {
@@ -58,6 +59,9 @@
packages.documentation = documentation; packages.documentation = documentation;
packages.theses = theses; packages.theses = theses;
packages.default = merge [documentation theses] name; packages.default = merge [documentation theses] name;
packages.pack = build_with_target "pack" (builtins.map (v: "target/pack/" + v) [
"tultemplate2" "tultemplate2.zip"
]);
} }
) )
); );