Verified Commit 29da3df7 authored by doshitan's avatar doshitan

Add nix gitignore filter

parent 1c3c93f8
......@@ -7,6 +7,7 @@
let
overlay = newPkgs: oldPkgs: {
niv = (import sources.niv {}).niv;
gitignoreSource = (import sources.gitignore {}).gitignoreSource;
merriweather = oldPkgs.stdenv.mkDerivation rec {
name = "merriweather-${version}";
......@@ -28,19 +29,22 @@ let
lib = oldPkgs.lib // (with oldPkgs.lib; rec {
applyFuncs = funcs: drv: foldl' (drv': f: f drv') drv funcs;
projectCleanSource = src: cleanSource (newPkgs.gitignoreSource src);
contentSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! (
(type == "symlink")
|| (type == "directory" && (baseName == "elm-stuff"))
);
contentCleanSource = src: cleanSource (cleanSourceWith { filter = contentSourceFilter; inherit src; });
contentCleanSource = src: projectCleanSource (cleanSourceWith { filter = contentSourceFilter; inherit src; });
# a bit redundant with gitignoreSource, but keeping it around for now
haskellSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! (
(type == "directory" && (baseName == "dist"))
|| (type == "directory" && (baseName == "dist-newstyle"))
);
haskellCleanSource = src: cleanSource (cleanSourceWith { filter = haskellSourceFilter; inherit src; });
haskellCleanSource = src: projectCleanSource (cleanSourceWith { filter = haskellSourceFilter; inherit src; });
});
origHaskellPackages =
......
{
"gitignore": {
"branch": "master",
"description": "Nix function for filtering local git sources",
"homepage": "",
"owner": "hercules-ci",
"repo": "gitignore",
"rev": "ec5dd0536a5e4c3a99c797b86180f7261197c124",
"sha256": "0k2r8y21rn4kr5dmddd3906x0733fs3bb8hzfpabkdav3wcy3klv",
"type": "tarball",
"url": "https://github.com/hercules-ci/gitignore/archive/ec5dd0536a5e4c3a99c797b86180f7261197c124.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment