1# This is a source filter function which cleans common build products
2# and files not needed to do a haskell build from a source directory.
4# This can avoid unnecessary builds when these files change.
6# It should be used with "pkgs.lib.cleanSourceWith". Alternatively,
7# use the convenience function "cleanSourceHaskell".
12 haskellSourceFilter = name: type:
13 let baseName = baseNameOf (toString name);
15 # Filter out cabal build products.
16 baseName == "dist" || baseName == "dist-newstyle" ||
17 baseName == "cabal.project.local" ||
18 lib.hasPrefix ".ghc.environment" baseName ||
19 # Filter out stack build products.
20 lib.hasPrefix ".stack-work" baseName ||
21 # Filter out files left by ghci
22 lib.hasSuffix ".hi" baseName ||
23 # Filter out files generated by "hasktags"
24 baseName == "TAGS" || baseName == "tags" ||
25 # Filter out files which are commonly edited but don't
26 # affect the cabal build.
27 lib.hasSuffix ".nix" baseName
30 # Like pkgs.lib.cleanSource, but adds Haskell files to the filter.
31 cleanSourceHaskell = { src, name ? null }:
33 clean = lib.cleanSourceWith {
34 filter = haskellSourceFilter;
35 src = lib.cleanSource src;
39 if (builtins.typeOf src) == "path"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list