From 06c30f68c602e9a460c58e4e0f04a762ff2fa1b7 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 24 Mar 2024 00:04:35 +0000 Subject: [PATCH] niv: wrap binary supplying runtime nix dependency in PATH --- pkgs/development/haskell-modules/configuration-nix.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 9897a6f2be0c..4d83fac79a5e 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -305,7 +305,13 @@ self: super: builtins.intersectAttrs super { ghc-debug-brick = enableSeparateBinOutput super.ghc-debug-brick; nixfmt = enableSeparateBinOutput super.nixfmt; calligraphy = enableSeparateBinOutput super.calligraphy; - niv = enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv); + niv = overrideCabal (drv: { + buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ]; + postInstall = '' + wrapProgram ''${!outputBin}/bin/niv --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.nix ]} + ''; + }) + (enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv)); ghcid = enableSeparateBinOutput super.ghcid; ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu); hnix = self.generateOptparseApplicativeCompletions [ "hnix" ] super.hnix;