forked from svanderburg/node2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.nix
68 lines (62 loc) · 1.85 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ nixpkgs ? <nixpkgs>
, systems ? [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]
}:
let
pkgs = import nixpkgs {};
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
jobset = import ./default.nix {
inherit pkgs;
system = builtins.currentSystem;
};
in
rec {
inherit (jobset) tarball;
package = pkgs.lib.genAttrs systems (system:
(import ./default.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package.override {
postInstall = ''
mkdir -p $out/share/doc/node2nix
$out/lib/node_modules/node2nix/node_modules/jsdoc/jsdoc.js -R README.md -r lib -d $out/share/doc/node2nix/apidox
mkdir -p $out/nix-support
echo "doc api $out/share/doc/node2nix/apidox" >> $out/nix-support/hydra-build-products
'';
}
);
tests = pkgs.lib.genAttrs systems (system:
{
v4 = import ./tests/override-v4.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
v6 = import ./tests/override-v6.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
grunt = import ./tests/grunt/override.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
});
release = pkgs.releaseTools.aggregate {
name = "node2nix-${version}";
constituents = [
tarball
]
++ map (system: builtins.getAttr system package) systems
++ pkgs.lib.flatten (map (system:
let
tests_ = tests."${system}".v4;
in
map (name: builtins.getAttr name tests_) (builtins.attrNames tests_)
) systems)
++ pkgs.lib.flatten (map (system:
let
tests_ = tests."${system}".v6;
in
map (name: builtins.getAttr name tests_) (builtins.attrNames tests_)
) systems)
++ map (system: tests."${system}".grunt) systems;
};
}