about summary refs log tree commit diff
path: root/third_party/gitignoreSource/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-03-19T17·49+0100
committersterni <sternenseemann@systemli.org>2021-03-19T23·21+0000
commit1799ddf7f035aa54271f296023470477b2d49a8d (patch)
treeb8d48d00488f3e938ecf3c80ebdfe5d66ae921ca /third_party/gitignoreSource/default.nix
parent4cf7dced54af817cf79c5e161568156add98d819 (diff)
fix(gs/xanthous): update xanthous.cabal, make CI catch such errors r/2289
Since xanthous has a checked-in package.yaml and cabal file, the
haskellPackages build infrastructure will use the package.yaml file for
all builds. The resulting problem is that our CI won't actually catch build
failures that would be observable with cabal or when building from the
sdist.

We fix that by filtering out the package.yaml file in pkg.nix
additionally to the filters specified in .gitignore. For this we need
gitignoreFilter from gitignore.nix which we expose as part of a functor
set from third_party.gitignoreSource to maintain interface
compatibility.

Change-Id: I337185f484d2027341f38031dcd78898706904eb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2609
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/gitignoreSource/default.nix')
-rw-r--r--third_party/gitignoreSource/default.nix22
1 files changed, 16 insertions, 6 deletions
diff --git a/third_party/gitignoreSource/default.nix b/third_party/gitignoreSource/default.nix
index d9d0262447fd..8bdd974e8dbe 100644
--- a/third_party/gitignoreSource/default.nix
+++ b/third_party/gitignoreSource/default.nix
@@ -1,8 +1,18 @@
 { pkgs, ... }:
 
-(import (pkgs.fetchFromGitHub {
-  owner = "hercules-ci";
-  repo = "gitignore";
-  rev = "f9e996052b5af4032fe6150bba4a6fe4f7b9d698";
-  sha256 = "0jrh5ghisaqdd0vldbywags20m2cxpkbbk5jjjmwaw0gr8nhsafv";
-}) { inherit (pkgs) lib; }).gitignoreSource
+let
+  gitignoreNix = import (pkgs.fetchFromGitHub {
+    owner = "hercules-ci";
+    repo = "gitignore";
+    rev = "f9e996052b5af4032fe6150bba4a6fe4f7b9d698";
+    sha256 = "0jrh5ghisaqdd0vldbywags20m2cxpkbbk5jjjmwaw0gr8nhsafv";
+  }) { inherit (pkgs) lib; };
+
+in {
+  __functor = _: gitignoreNix.gitignoreSource;
+
+  # expose extra functions here
+  inherit (gitignoreNix)
+    gitignoreFilter
+    ;
+}