-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.nix
52 lines (38 loc) · 1.17 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
{ nixopsSrc ? { outPath = ./.; revCount = 0; shortRev = "abcdef"; rev = "HEAD"; }
, officialRelease ? false
, nixpkgs ? <nixpkgs>
}:
let
pkgs = import nixpkgs { };
version = "1.6.1" + (if officialRelease then "" else "pre${toString nixopsSrc.revCount}_${nixopsSrc.shortRev}");
in
rec {
build = pkgs.lib.genAttrs [ "x86_64-linux" "i686-linux" "x86_64-darwin" ] (system:
with import nixpkgs { inherit system; };
python2Packages.buildPythonPackage rec {
name = "nixops-vultr-${version}";
namePrefix = "";
src = ./.;
prePatch = ''
for i in setup.py; do
substituteInPlace $i --subst-var-by version ${version}
done
'';
buildInputs = [ python2Packages.nose python2Packages.coverage ];
propagatedBuildInputs = with python2Packages;
[
vultr
];
postInstall =
''
mkdir -p $out/share/nix/nixops-vultr
cp -av nix/* $out/share/nix/nixops-vultr
'';
# For "nix-build --run-env".
shellHook = ''
export PYTHONPATH=$(pwd):$PYTHONPATH
export PATH=$(pwd)/scripts:${openssh}/bin:$PATH
'';
doCheck = true;
});
}