From 59d3c26b458dd7962ca65245c0051124eb4a6f8f Mon Sep 17 00:00:00 2001 From: "aravind.mallapureddy" Date: Mon, 6 Nov 2023 13:31:09 +0530 Subject: [PATCH 1/2] modified callPackage based on custom-default.nix file. --- nix/build-haskell-package.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nix/build-haskell-package.nix b/nix/build-haskell-package.nix index 3563395a..41a62670 100644 --- a/nix/build-haskell-package.nix +++ b/nix/build-haskell-package.nix @@ -34,8 +34,13 @@ lib.pipe root (mkNewStorePath "source-${name}") (x: log.traceDebug "${name}.mkNewStorePath ${x.outPath}" x) - (root: self.callCabal2nix name root { }) - (x: log.traceDebug "${name}.cabal2nixDeriver ${x.cabal2nixDeriver.outPath}" x) + (root: if lib.pathExists (lib.concatStringsSep "/" [root "custom-default.nix"]) + then + let pkgInfo = self.callPackage (lib.concatStringsSep "/" [root "custom-default.nix"]) {}; + in pkgInfo + else + let pkgInfo = self.callCabal2nix name root { }; + in (log.traceDebug "${name}.cabal2nixDeriver ${pkgInfo.cabal2nixDeriver.outPath}" pkgInfo)) # Make sure all files we use are included in the sdist, as a check # for release-worthiness. From 21728488a3cc76b55f9ff9a1efd9a4d263b47e10 Mon Sep 17 00:00:00 2001 From: "aravind.mallapureddy" Date: Tue, 14 Nov 2023 13:41:42 +0530 Subject: [PATCH 2/2] Reformatted build-haskell-package nix file. --- nix/build-haskell-package.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nix/build-haskell-package.nix b/nix/build-haskell-package.nix index 41a62670..0c9bb826 100644 --- a/nix/build-haskell-package.nix +++ b/nix/build-haskell-package.nix @@ -34,13 +34,14 @@ lib.pipe root (mkNewStorePath "source-${name}") (x: log.traceDebug "${name}.mkNewStorePath ${x.outPath}" x) - (root: if lib.pathExists (lib.concatStringsSep "/" [root "custom-default.nix"]) - then - let pkgInfo = self.callPackage (lib.concatStringsSep "/" [root "custom-default.nix"]) {}; - in pkgInfo - else - let pkgInfo = self.callCabal2nix name root { }; - in (log.traceDebug "${name}.cabal2nixDeriver ${pkgInfo.cabal2nixDeriver.outPath}" pkgInfo)) + (root: + if lib.pathExists (lib.concatStringsSep "/" [ root "custom-default.nix" ]) + then + let pkgInfo = self.callPackage (lib.concatStringsSep "/" [ root "custom-default.nix" ]) { }; + in pkgInfo + else + let pkgInfo = self.callCabal2nix name root { }; + in (log.traceDebug "${name}.cabal2nixDeriver ${pkgInfo.cabal2nixDeriver.outPath}" pkgInfo)) # Make sure all files we use are included in the sdist, as a check # for release-worthiness.