From f37e14fa5d96a3e50a044644fc72ec6ee57a034c Mon Sep 17 00:00:00 2001 From: Olivier Le Doeuff Date: Sat, 14 Sep 2024 10:14:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20run=20pre/post=20hook=20in=20bui?= =?UTF-8?q?ld/install/installCheck=20phases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index 0673200..05b426e 100644 --- a/flake.nix +++ b/flake.nix @@ -127,29 +127,41 @@ out = [ "out" ]; buildPhase = '' + runHook preBuild + echo "Building qaterialhotreloadapp version ${version} in ${cmakeConfigType} mode" cmake --build . --config ${cmakeConfigType} --target \ QaterialHotReloadApp \ --parallel $NIX_BUILD_CORES + + runHook postBuild ''; doCheck = pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform; installPhase = '' + runHook preInstall + echo "Installing qaterialhotreloadapp version ${version} in ${cmakeConfigType} mode into $out" mkdir -p $out/bin cp -r QaterialHotReloadApp $out/bin + + runHook postInstall ''; doInstallCheck = doCheck; installCheckPhase = pkgs.lib.optionalString doInstallCheck '' + runHook preInstallCheck + echo "Run shell hook" ${shellHook} xvfb-run dbus-run-session \ --config-file=${pkgs.dbus}/share/dbus-1/session.conf \ $out/bin/QaterialHotReloadApp --help + + runHook postInstallCheck ''; };