Skip to content

Commit

Permalink
Add pre/post hooks to custom phases
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfullmer committed Aug 21, 2024
1 parent 3b47152 commit 893b0f6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ in
name = "l4t-core-wrapper";
phases = [ "installPhase" ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib
ln -s ${l4t-core}/lib/libnvrm_gpu.so $out/lib/libnvrm_gpu.so
ln -s ${l4t-core}/lib/libnvrm_mem.so $out/lib/libnvrm_mem.so
runHook postInstall
'';
};
in
Expand Down
4 changes: 4 additions & 0 deletions pkgs/board-automation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ stdenv.mkDerivation {
'';

installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp tools/board_automation/* $out/bin
runHook postInstall
'';
}
4 changes: 4 additions & 0 deletions pkgs/cuda-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ let
'';

installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';

meta = {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/flash-tools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ let
noDumpEnvVars = true;

installPhase = ''
runHook preInstall
mkdir -p $out
cp -r . $out/
runHook postInstall
'';

# Stuff to put into PATH for flash.sh
Expand Down
4 changes: 4 additions & 0 deletions pkgs/jetson-benchmarks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ stdenvNoCC.mkDerivation {
substituteInPlace utils/utilities.py --replace "/usr/src/tensorrt" "${cudaPackages.tensorrt}"
'';
installPhase = ''
runHook preInstall
mkdir -p models
cp -r $models/. models
Expand All @@ -104,6 +106,8 @@ stdenvNoCC.mkDerivation {
mkdir -p $out/bin
cp -r ${./scripts}/. $out/bin
chmod +x $out/bin/*
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/run-jetson-benchmarks \
Expand Down
4 changes: 4 additions & 0 deletions pkgs/l4t/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ let
'';

installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';

meta = {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/ota-utils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ stdenvNoCC.mkDerivation {
dontBuild = true;

installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share
cp ${./ota-setup-efivars.sh} $out/bin/ota-setup-efivars
cp ${./ota-apply-capsule-update.sh} $out/bin/ota-apply-capsule-update
Expand All @@ -28,5 +30,7 @@ stdenvNoCC.mkDerivation {
# patchShebangs does not seem to work here for some reason
substituteInPlace $out/bin/* --replace '#!/usr/bin/env bash' '#!${bash}/bin/bash'
runHook postInstall
'';
}

0 comments on commit 893b0f6

Please sign in to comment.