From 41ee90351bb2dafc630b689d40ec355e7beb22aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 6 Jun 2022 03:03:12 +0200 Subject: [PATCH] Fix fixupPhase overwrite --- vmtools/flake.nix | 4 +++- vmtools/pkgs/triton-vmtools.nix | 28 +++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/vmtools/flake.nix b/vmtools/flake.nix index f85ba03..fcbdc04 100644 --- a/vmtools/flake.nix +++ b/vmtools/flake.nix @@ -7,7 +7,9 @@ outputs = { self, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system: let - triton-vmtools = import ./pkgs/triton-vmtools.nix { pkgs = import nixpkgs { inherit system; }; }; + pkgs = import nixpkgs { inherit system; }; + + triton-vmtools = import ./pkgs/triton-vmtools.nix { inherit pkgs; }; in { diff --git a/vmtools/pkgs/triton-vmtools.nix b/vmtools/pkgs/triton-vmtools.nix index 3f56b6f..5df459e 100644 --- a/vmtools/pkgs/triton-vmtools.nix +++ b/vmtools/pkgs/triton-vmtools.nix @@ -23,7 +23,19 @@ stdenv.mkDerivation rec { parted ]; - fixupPhase = '' + patches = [ + ./0001-fix-paths-in-scripts.patch + ]; + + installPhase = '' + sdcvmtools="src/linux" + mkdir -p $out/bin $out/lib $out/share/man/man1 + cp -r ''${sdcvmtools}/lib/smartdc $out/lib/ + cp -r ''${sdcvmtools}/usr/sbin/mdata-* $out/bin/ + cp -r ''${sdcvmtools}/usr/share/man/man1/mdata-* $out/share/man/man1/ + ''; + + preFixup = '' for file in $out/lib/smartdc/* do substituteInPlace ''$file \ @@ -36,20 +48,6 @@ stdenv.mkDerivation rec { --replace "/usr/sbin/" "$out/bin/" ''; - patches = [ - ./0001-fix-paths-in-scripts.patch - ]; - - installPhase = '' - echo "Installing SmartOS VM Guest Tools..." - sdcvmtools="src/linux" - mkdir -p $out/bin $out/lib $out/share/man/man1 - cp -r ''${sdcvmtools}/lib/smartdc $out/lib/ - cp -r ''${sdcvmtools}/usr/sbin/mdata-* $out/bin/ - cp -r ''${sdcvmtools}/usr/share/man/man1/mdata-* $out/share/man/man1/ - echo "SmartOS VM Guest Tools installed" - ''; - meta = with lib; { description = "The VM Guest tools contains scripts and drivers that are used to create virtualized machine images in SmartOS."; homepage = "https://github.com/TritonDataCenter/sdc-vmtools";