From 4bbbd9ded5a88a2d0681aab86892e1058b538467 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 6 Jun 2024 15:13:56 -0400 Subject: Set explicit srcs in hand-written bild build I'm not sure when `lib.fileset` was introduced, but it allows me to easily create a source that can be unpacked by the `unpackPhase` which also maintains the directory structure. This means I can pass a subset of the whole repo to the builder, and changing an unrelated file (outside of that subset) won't cause a rebuild of bild, which wasn't the case before. --- Biz/Bild.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Biz/Bild.nix b/Biz/Bild.nix index c24cecd..7d23d6a 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -107,7 +107,18 @@ let # hand-written builder we need bild = self.stdenv.mkDerivation { name = "bild"; - src = ../.; + srcs = self.lib.fileset.toSource { + root = ../.; + fileset = self.lib.fileset.unions [ + ../Alpha.hs + ../Biz/Bild.hs + ../Biz/Bild/Meta.hs + ../Biz/Cli.hs + ../Biz/Log.hs + ../Biz/Namespace.hs + ../Biz/Test.hs + ]; + }; nativeBuildInputs = [ self.haskell.ghcPackageSetBild ]; buildInputs = [ self.makeWrapper ]; propagatedBuildInputs = with self.pkgs; [ -- cgit v1.2.3