2022-11-24 08:07:09 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
2023-09-18 06:52:53 +00:00
|
|
|
, buildGo121Module
|
2022-11-24 08:07:09 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
2023-05-30 05:43:33 +00:00
|
|
|
, installShellFiles
|
2022-11-24 08:07:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
generic =
|
2023-12-25 03:55:18 +00:00
|
|
|
{ buildGoModule, version, sha256, vendorHash, license, ... }@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs [ "buildGoModule" "version" "sha256" "vendorHash" "license" ];
|
2022-11-24 08:07:09 +00:00
|
|
|
in
|
|
|
|
buildGoModule (rec {
|
|
|
|
pname = "nomad";
|
2023-09-13 04:44:46 +00:00
|
|
|
inherit version vendorHash;
|
2022-11-24 08:07:09 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hashicorp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2023-05-30 05:43:33 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-11-24 08:07:09 +00:00
|
|
|
# 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" ];
|
|
|
|
|
2023-05-30 05:43:33 +00:00
|
|
|
postInstall = ''
|
|
|
|
echo "complete -C $out/bin/nomad nomad" > nomad.bash
|
|
|
|
installShellCompletion nomad.bash
|
|
|
|
'';
|
|
|
|
|
2022-11-24 08:07:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.nomadproject.io/";
|
|
|
|
description = "A Distributed, Highly Available, Datacenter-Aware Scheduler";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "nomad";
|
2023-12-25 03:55:18 +00:00
|
|
|
inherit license;
|
2023-12-10 14:26:09 +00:00
|
|
|
maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes amaxine techknowlogick cottand ];
|
2022-11-24 08:07:09 +00:00
|
|
|
};
|
|
|
|
} // 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
|
|
|
|
|
2024-01-16 23:51:32 +00:00
|
|
|
nomad = nomad_1_7;
|
2022-11-24 08:07:09 +00:00
|
|
|
|
2024-01-19 22:17:01 +00:00
|
|
|
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";
|
2023-04-16 09:06:02 +00:00
|
|
|
|
|
|
|
nomad_1_5 = generic {
|
2023-12-14 15:12:03 +00:00
|
|
|
buildGoModule = buildGo121Module;
|
2024-02-17 17:52:38 +00:00
|
|
|
version = "1.5.15";
|
|
|
|
sha256 = "sha256-OFmGOU+ObA0+BS48y0ZyyxR+VI5DYL39peVKcyVHgGI=";
|
|
|
|
vendorHash = "sha256-Ds94lB43cyMNyRJZti0mZDWGTtSdwY31dDijfAUxR0I=";
|
2023-12-25 03:55:18 +00:00
|
|
|
license = lib.licenses.mpl20;
|
2023-04-16 09:06:02 +00:00
|
|
|
passthru.tests.nomad = nixosTests.nomad;
|
|
|
|
preCheck = ''
|
2023-08-28 21:39:47 +00:00
|
|
|
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
|
2023-04-16 09:06:02 +00:00
|
|
|
'';
|
|
|
|
};
|
2023-07-19 15:20:03 +00:00
|
|
|
|
|
|
|
nomad_1_6 = generic {
|
2023-09-18 06:52:53 +00:00
|
|
|
buildGoModule = buildGo121Module;
|
2024-02-17 17:52:58 +00:00
|
|
|
version = "1.6.8";
|
|
|
|
sha256 = "sha256-lc/HZgyzqWZNW2WHOFZ43gCeL5Y2hwK4lXPgWGboPOY=";
|
|
|
|
vendorHash = "sha256-ecLhq4OHDhA1Bd/97NMpfePqtuCtVje3BdvCzcwWzas=";
|
2023-12-25 03:55:18 +00:00
|
|
|
license = lib.licenses.mpl20;
|
2023-07-19 15:20:03 +00:00
|
|
|
passthru.tests.nomad = nixosTests.nomad;
|
|
|
|
preCheck = ''
|
2023-08-28 21:39:47 +00:00
|
|
|
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
|
2023-07-19 15:20:03 +00:00
|
|
|
'';
|
|
|
|
};
|
2023-12-08 18:43:34 +00:00
|
|
|
|
|
|
|
nomad_1_7 = generic {
|
|
|
|
buildGoModule = buildGo121Module;
|
2024-04-17 01:26:52 +00:00
|
|
|
version = "1.7.7";
|
|
|
|
sha256 = "sha256-4nuRheidR6rIoytrnDQdIP69f+sBLJ3Ias5DvqVaLFc=";
|
|
|
|
vendorHash = "sha256-ZuaD8iDsT+/eW0QUavf485R804Jtjl76NcQWYHA8QII=";
|
2023-12-25 03:55:18 +00:00
|
|
|
license = lib.licenses.bsl11;
|
2023-12-08 18:43:34 +00:00
|
|
|
passthru.tests.nomad = nixosTests.nomad;
|
|
|
|
preCheck = ''
|
|
|
|
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
|
|
|
|
'';
|
|
|
|
};
|
2022-11-24 08:07:09 +00:00
|
|
|
}
|