forked from nix-community/vulnix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
45 lines (36 loc) · 1.25 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
{ supportedSystems ? [ "x86_64-linux" ],
}:
let
# I would love to pin the version here, but Hydra wants to pass it in
pkgs = import <nixpkgs> {};
buildFor = systems:
builtins.listToAttrs (map (system:
{ name = system;
value = import ./default.nix { pkgs = import pkgs.path { inherit system; }; };
}) systems);
version = pkgs.lib.removeSuffix "\n" (
builtins.head (pkgs.lib.splitString "\n" (
builtins.readFile ./VERSION)));
jobs = {
tarball = pkgs.stdenv.mkDerivation {
name = "vulnix-${version}-tarball";
src = ./.;
buildInputs = with pkgs.python3Packages; [ python setuptools ];
buildPhase = ''
python3 setup.py sdist --formats=gztar
'';
installPhase = ''
mkdir -p $out $out/nix-support
mv dist/vulnix-${version}.tar.gz $out/
echo "file source-dist $out/vulnix-${version}.tar.gz" > $out/nix-support/hydra-build-products
'';
};
build = buildFor supportedSystems;
release = pkgs.releaseTools.aggregate {
name = "vulnix-${version}";
meta.description = "Aggregate job containing the release-critical jobs.";
constituents = [ jobs.tarball ] ++
(map (x: builtins.attrValues x) [ jobs.build ]);
};
};
in jobs