-
-
Save nathan-at-least/0d8b5b15779833fa638eb5733f4caa07 to your computer and use it in GitHub Desktop.
Failing to filter source appropriately in a nix build.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
inherit (builtins) any filterSource; | |
nixpkgs = import ./nixpkgs.nix; | |
inherit (nixpkgs.lib.debug) traceSeq traceVal; | |
# Parent of util is nix. | |
# Parent of nix is srcDir: | |
rawSrcDir = ../../..; | |
_skipPaths = map (n: rawSrcDir + "/${n}") [ | |
".git" | |
"nix" | |
]; | |
skipPaths = traceSeq "${builtins.toJSON _skipPaths}" _skipPaths; | |
selectPath = path: kind: | |
let | |
isSkipPath = skipPath: | |
traceSeq "Comparing path ${path} to skipPath ${skipPath}" ( | |
path == skipPath | |
); | |
in | |
!(any isSkipPath skipPaths); | |
in | |
filterSource selectPath rawSrcDir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment