Unverified Commit 90707b0b authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

nh-unwrapped: fix postInstall cleanup (#500839)

parents a64ad35d f938115a
Loading
Loading
Loading
Loading
+27 −20
Original line number Diff line number Diff line
@@ -71,12 +71,17 @@ rustPlatform.buildRustPackage (finalAttrs: {

  nativeInstallCheckInputs = [ versionCheckHook ];

  postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
  postInstall =
    lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
      let
        emulator = stdenv.hostPlatform.emulator buildPackages;
      in
      ''
        # Run both shell completion and manpage generation tasks. Unlike the
        # fine-grained variants, the 'dist' command doesn't allow specifying the
        # path but that's fine, because we can simply install them from the implicit
        # output directories.
    $out/bin/xtask dist
        ${emulator} $out/bin/xtask dist

        # The dist task above should've created
        #  1. Shell completions in comp/
@@ -88,7 +93,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
        # about what we're installing, or this will fail.
        installShellCompletion --cmd ${finalAttrs.meta.mainProgram} ./comp/*.{bash,fish,zsh,nu}
        installManPage ./man/nh.1

      ''
    )
    + ''
      # Avoid populating PATH with an 'xtask' cmd
      rm $out/bin/xtask
    '';