mirror of
https://github.com/nmattia/niv.git
synced 2024-09-16 01:47:08 +03:00
Re-add sourceByRegex
Otherwise niv requires a full compilation when any file changes
This commit is contained in:
parent
099f9ea921
commit
d04a684419
28
default.nix
28
default.nix
@ -4,8 +4,32 @@
|
||||
|
||||
with rec
|
||||
{ files = pkgs.callPackage ./nix/files.nix {};
|
||||
gitignoreSource = (pkgs.callPackage sources.gitignore {}).gitignoreSource;
|
||||
niv-source = gitignoreSource ./.;
|
||||
sourceByRegex = name: src: regexes:
|
||||
builtins.path
|
||||
{ filter = (path: type:
|
||||
let
|
||||
relPath = pkgs.lib.removePrefix (toString src + "/") (toString path);
|
||||
accept = pkgs.lib.any (re: builtins.match re relPath != null) regexes;
|
||||
in accept);
|
||||
inherit name;
|
||||
path = src;
|
||||
};
|
||||
niv-source = sourceByRegex "niv" ./.
|
||||
[ "^package.yaml$"
|
||||
"^README.md$"
|
||||
"^LICENSE$"
|
||||
"^app$"
|
||||
"^app.*.hs$"
|
||||
"^src$"
|
||||
"^src/Niv$"
|
||||
"^src/Niv/GitHub$"
|
||||
"^src/Niv/Update$"
|
||||
"^src.*.hs$"
|
||||
"^README.md$"
|
||||
"^nix$"
|
||||
"^nix.sources.nix$"
|
||||
];
|
||||
|
||||
haskellPackages = pkgs.haskellPackages.override
|
||||
{ overrides = _: haskellPackages:
|
||||
{ niv =
|
||||
|
Loading…
Reference in New Issue
Block a user