about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2024-07-12 11:31:33 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2024-07-12 17:58:00 -0300
commite72a3ac6b41a672f1d1c5760b5ee9485e65d3017 (patch)
treeedbb3e43847b23075d69e51c363237484221d119
parent4556d198f134719637f0b50e27dd34577255627b (diff)
k3s: add missing phases hook
-rw-r--r--pkgs/applications/networking/cluster/k3s/builder.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix
index 5c2820300b3f6..28e55da9b64d0 100644
--- a/pkgs/applications/networking/cluster/k3s/builder.nix
+++ b/pkgs/applications/networking/cluster/k3s/builder.nix
@@ -367,6 +367,7 @@ buildGoModule rec {
   # https://github.com/NixOS/nixpkgs/pull/158089#discussion_r799965694
   # So, why do we use buildGoModule at all? For the `vendorHash` / `go mod download` stuff primarily.
   buildPhase = ''
+    runHook preBuild
     patchShebangs ./scripts/package-cli ./scripts/download ./scripts/build-upload
 
     # copy needed 'go generate' inputs into place
@@ -387,12 +388,14 @@ buildGoModule rec {
 
     ./scripts/package-cli
     mkdir -p $out/bin
+    runHook postBuild
   '';
 
   # Otherwise it depends on 'getGoDirs', which is normally set in buildPhase
   doCheck = false;
 
   installPhase = ''
+    runHook preInstall
     # wildcard to match the arm64 build too
     install -m 0755 dist/artifacts/k3s* -D $out/bin/k3s
     wrapProgram $out/bin/k3s \
@@ -404,11 +407,14 @@ buildGoModule rec {
     install -m 0755 ${k3sKillallSh} -D $out/bin/k3s-killall.sh
     wrapProgram $out/bin/k3s-killall.sh \
       --prefix PATH : ${lib.makeBinPath (k3sRuntimeDeps ++ k3sKillallDeps)}
+    runHook postInstall
   '';
 
   doInstallCheck = true;
   installCheckPhase = ''
+    runHook preInstallCheck
     $out/bin/k3s --version | grep -F "v${k3sVersion}" >/dev/null
+    runHook postInstallCheck
   '';
 
   passthru.updateScript = updateScript;