on master help sign in
Merge pull request #655 from obsidiansystems/eac@better-source-filtering

Better source filtering

commit1ecc90fe8e01e6d6646a63f1d818e30501d1a98c authorElliot Cameron <3noch@users.noreply.github.com> dateMon 24 Feb 2020, 17:06 (7 years ago) parent01334499ed4bd5
3 files changed+23−8
default.nix+7−8 dep/gitignore.nix/default.nix+8 dep/gitignore.nix/github.json+8
default.nix+7−8
@@ -5,10 +5,13 @@
55, reflex-platform-func ? import ./dep/reflex-platform
66}:
77let
8− cleanSource = builtins.filterSource (name: _: let baseName = builtins.baseNameOf name; in !(
9− builtins.match "^\\.ghc\\.environment.*" baseName != null ||
10− baseName == "cabal.project.local"
11− ));
8+ reflex-platform = getReflexPlatform system;
9+ inherit (reflex-platform) hackGet nixpkgs;
10+ pkgs = nixpkgs;
11+
12+ inherit (import dep/gitignore.nix { inherit (nixpkgs) lib; }) gitignoreSource;
13+
14+ cleanSource = src: gitignoreSource (pkgs.lib.cleanSource src);
1215
1316 commandRuntimeDeps = pkgs: with pkgs; [
1417 coreutils
@@ -102,10 +105,6 @@ let
102105 ];
103106 };
104107
105− reflex-platform = getReflexPlatform system;
106− inherit (reflex-platform) hackGet nixpkgs;
107− pkgs = nixpkgs;
108−
109108 # The haskell environment used to build Obelisk itself, e.g. the 'ob' command
110109 ghcObelisk = reflex-platform.ghc;
111110
dep/gitignore.nix/default.nixnew file+8
@@ -0,0 +1,8 @@
1+# DO NOT HAND-EDIT THIS FILE
2+let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
3+ if !fetchSubmodules && !private then builtins.fetchTarball {
4+ url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5+ } else (import <nixpkgs> {}).fetchFromGitHub {
6+ inherit owner repo rev sha256 fetchSubmodules private;
7+ };
8+in import (fetch (builtins.fromJSON (builtins.readFile ./github.json)))
dep/gitignore.nix/github.jsonnew file+8
@@ -0,0 +1,8 @@
1+{
2+ "owner": "hercules-ci",
3+ "repo": "gitignore.nix",
4+ "branch": "master",
5+ "private": false,
6+ "rev": "7415c4feb127845553943a3856cbc5cb967ee5e0",
7+ "sha256": "1zd1ylgkndbb5szji32ivfhwh04mr1sbgrnvbrqpmfb67g2g3r9i"
8+}