1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-07 22:36:53 +03:00

Re-add sourceByRegex

Otherwise niv requires a full compilation when any file changes
This commit is contained in:
Nicolas Mattia 2019-07-01 16:00:55 +02:00
parent 099f9ea921
commit d04a684419

View File

@ -4,8 +4,32 @@
with rec with rec
{ files = pkgs.callPackage ./nix/files.nix {}; { files = pkgs.callPackage ./nix/files.nix {};
gitignoreSource = (pkgs.callPackage sources.gitignore {}).gitignoreSource; sourceByRegex = name: src: regexes:
niv-source = gitignoreSource ./.; 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 haskellPackages = pkgs.haskellPackages.override
{ overrides = _: haskellPackages: { overrides = _: haskellPackages:
{ niv = { niv =