nix: wrapper to launch ezidam with env variables

This commit is contained in:
Philippe Loctaux 2023-11-20 22:31:38 +01:00
parent 3b9f4792dc
commit 580c212e7d

View file

@ -99,17 +99,10 @@
ezidamAssetStatic ezidamAssetStatic
]; ];
ezidam = pkgs.stdenv.mkDerivation { # How to launch binary
inherit ezidamBinary ezidamAssets; ezidam = pkgs.writeShellScriptBin "ezidam" ''
name = metadata.pname; EZIDAM_TEMPLATE_DIR=${ezidamAssetTemplate} EZIDAM_STATIC_DIR=${ezidamAssetStatic} ${ezidamBinary}/bin/ezidam
phases = [ "unpackPhase" "installPhase" ]; '';
dontUnpack = true;
installPhase = ''
mkdir -p $out
cp -rv $ezidamBinary $out
cp -rv $ezidamAssets $out
'';
};
# Docker image # Docker image
dockerImage = pkgs.dockerTools.buildLayeredImage { dockerImage = pkgs.dockerTools.buildLayeredImage {
@ -142,7 +135,7 @@
{ {
apps.default = { apps.default = {
type = "app"; type = "app";
program = "${ezidamBinary}/bin/ezidam"; program = "${ezidam}/bin/ezidam";
}; };
packages = { packages = {