Skip to content

Commit d0f7480

Browse files
author
Shay Bergmann
authored
Merge pull request #703 from input-output-hk/etcm-108-cleangit
[ETCM-108] Factor out mkSrc
2 parents 8a18c76 + 1bc49be commit d0f7480

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

nix/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let
1717

1818
inherit (final.mantisPkgs) mantis;
1919

20-
inherit (final.mantisPkgs) mantis-unwrapped;
20+
mkSrc = import sources.nix-mksrc { inherit (final) lib; };
2121
};
2222
in import sources.nixpkgs {
2323
inherit system;

nix/pkgs/mantis/default.nix

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
{ src, lib, gitignoreSource, callPackage, jre }: rec {
2-
3-
mkSrc = src:
4-
let
5-
isGit = builtins.pathExists (src + "/.git");
6-
repo = builtins.fetchGit { url = src; submodules = true; };
7-
dirty = repo.revCount == 0;
8-
filterSrc = src:
9-
lib.cleanSourceWith {
10-
inherit src;
11-
filter = path: _: !lib.hasSuffix "nix" path;
12-
};
13-
in if isGit then
14-
if dirty then filterSrc (gitignoreSource src) else repo
15-
else
16-
src;
1+
{ src, mkSrc, lib, gitignoreSource, callPackage, jre }: rec {
172

183
mantis-source = mkSrc src;
194

nix/sources.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
"url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
38+
"nix-mksrc": {
39+
"branch": "master",
40+
"description": null,
41+
"homepage": "",
42+
"owner": "input-output-hk",
43+
"repo": "nix-mksrc",
44+
"rev": "c446c2da50209f06d75df9f06f9faa738939b54d",
45+
"sha256": "1mnp88fvg9rkl211zsg1mjkx0kk63l9q4fdy3a4avbq8z9bjb1gf",
46+
"type": "tarball",
47+
"url": "https://github.com/input-output-hk/nix-mksrc/archive/c446c2da50209f06d75df9f06f9faa738939b54d.tar.gz",
48+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
49+
},
3850
"nixkite": {
3951
"branch": "master",
4052
"description": "Nixkite is a Buildkite pipeline generation tool using the NixOS module system",

0 commit comments

Comments
 (0)