Skip to content

Commit 2ff6f44

Browse files
author
Shay Bergmann
committed
Fetch mkSrc from github
1 parent 7e37b74 commit 2ff6f44

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

nix/default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{ system ? builtins.currentSystem, sources ? import ./sources.nix, src ? ../. }:
2-
32
let
43
overlay = final: prev: {
54
inherit sources;
@@ -15,9 +14,11 @@ let
1514
inherit src;
1615
};
1716

18-
inherit (final.mantisPkgs) mantis mantis-unwrapped mantis-source mkSrc;
17+
mkSrc = import sources.nix-mksrc { inherit (final) lib; };
18+
inherit (final.mantisPkgs) mantis mantis-unwrapped mantis-source;
1919
};
20-
in import sources.nixpkgs {
20+
in
21+
import sources.nixpkgs {
2122
inherit system;
2223
overlays = [ overlay ];
2324
}

nix/pkgs/mantis/default.nix

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

203
mantis-source = mkSrc src;
214

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)