nixpkgs/pkgs/applications/networking/cluster/nomad/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.9 KiB
Nix
Raw Normal View History

2022-11-24 08:07:09 +00:00
{ lib
, buildGoModule
, 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 =
{ 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";
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";
mainProgram = "nomad";
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
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 {
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=";
license = lib.licenses.mpl20;
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
export PATH="$PATH:$NIX_BUILD_TOP/go/bin"
'';
};
2023-07-19 15:20:03 +00:00
nomad_1_6 = generic {
buildGoModule = buildGo121Module;
2024-02-17 17:52:58 +00:00
version = "1.6.8";
sha256 = "sha256-lc/HZgyzqWZNW2WHOFZ43gCeL5Y2hwK4lXPgWGboPOY=";
vendorHash = "sha256-ecLhq4OHDhA1Bd/97NMpfePqtuCtVje3BdvCzcwWzas=";
license = lib.licenses.mpl20;
2023-07-19 15:20:03 +00:00
passthru.tests.nomad = nixosTests.nomad;
preCheck = ''
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=";
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
}