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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
{ lib
, buildGoModule
, buildGo121Module
, fetchFromGitHub
, nixosTests
, installShellFiles
}:
let
generic =
{ buildGoModule, version, sha256, vendorHash, license, ... }@attrs:
let attrs' = builtins.removeAttrs attrs [ "buildGoModule" "version" "sha256" "vendorHash" "license" ];
in
buildGoModule (rec {
pname = "nomad";
inherit version vendorHash;
subPackages = [ "." ];
src = fetchFromGitHub {
owner = "hashicorp";
repo = pname;
rev = "v${version}";
inherit sha256;
};
nativeBuildInputs = [ installShellFiles ];
# ui:
# Nomad release commits include the compiled version of the UI, but the file
# is only included if we build with the ui tag.
tags = [ "ui" ];
postInstall = ''
echo "complete -C $out/bin/nomad nomad" > nomad.bash
installShellCompletion nomad.bash
'';
meta = with lib; {
homepage = "https://www.nomadproject.io/";
description = "Distributed, Highly Available, Datacenter-Aware Scheduler";
mainProgram = "nomad";
inherit license;
maintainers = with maintainers; [ rushmorem pradeepchhetri techknowlogick cottand ];
};
} // attrs');
in
rec {
# Nomad never updates major go versions within a release series and is unsupported
# on Go versions that it did not ship with. Due to historic bugs when compiled
# with different versions we pin Go for all versions.
# Upstream partially documents used Go versions here
# https://github.com/hashicorp/nomad/blob/master/contributing/golang.md
nomad = nomad_1_7;
nomad_1_4 = throw "nomad_1_4 is no longer supported upstream. You can switch to using a newer version of the nomad package, or revert to older nixpkgs if you cannot upgrade";
nomad_1_5 = generic {
buildGoModule = buildGo121Module;
version = "1.5.15";
sha256 = "sha256-OFmGOU+ObA0+BS48y0ZyyxR+VI5DYL39peVKcyVHgGI=";
vendorHash = "sha256-Ds94lB43cyMNyRJZti0mZDWGTtSdwY31dDijfAUxR0I=";
license = lib.licenses.mpl20;
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
'';
};
nomad_1_6 = generic {
buildGoModule = buildGo121Module;
version = "1.6.10";
sha256 = "sha256-kiMdpJzjF0S7lrTX3sBFkWm0Gac9a+qlwCPcMKeVXXQ=";
vendorHash = "sha256-qnsPPV/NWTrqUa1v1CL16WfCH7B0zW9ZSnEmtqvotqI=";
license = lib.licenses.mpl20;
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
'';
};
nomad_1_7 = generic {
buildGoModule = buildGo121Module;
version = "1.7.7";
sha256 = "sha256-4nuRheidR6rIoytrnDQdIP69f+sBLJ3Ias5DvqVaLFc=";
vendorHash = "sha256-ZuaD8iDsT+/eW0QUavf485R804Jtjl76NcQWYHA8QII=";
license = lib.licenses.bsl11;
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
'';
};
nomad_1_8 = generic {
buildGoModule = buildGo121Module;
version = "1.8.0";
sha256 = "sha256-j/9wvnxYhv6h344904cO2Fi6pNeSV5IfcqS4mSjDqpo=";
vendorHash = "sha256-jNdLLs/mfARl5Uk9RalwSDFLAKqIISEkek3l1wV8EYE=";
license = lib.licenses.bsl11;
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
'';
};
}
|