nomad: refactor

zowoq 9063accd e0975233

+76 -85
-10
pkgs/applications/networking/cluster/nomad/1.2.nix
··· 1 - { callPackage 2 - , buildGoModule 3 - }: 4 - 5 - callPackage ./generic.nix { 6 - inherit buildGoModule; 7 - version = "1.2.15"; 8 - sha256 = "sha256-p9yRjSapQAhuHv+slUmYI25bUb1N1A7LBiJOdk1++iI="; 9 - vendorSha256 = "sha256-6d3tE337zVAIkzQzAnV2Ya5xwwhuzmKgtPUJcJ9HRto="; 10 - }
···
-10
pkgs/applications/networking/cluster/nomad/1.3.nix
··· 1 - { callPackage 2 - , buildGoModule 3 - }: 4 - 5 - callPackage ./generic.nix { 6 - inherit buildGoModule; 7 - version = "1.3.8"; 8 - sha256 = "sha256-hUmDWgGV8HAXew8SpcbhaiaF9VfBN5mk1W7t5lhnZ9I="; 9 - vendorSha256 = "sha256-IfYobyDFriOldJnNfRK0QVKBfttoZZ1iOkt4cBQxd00="; 10 - }
···
-10
pkgs/applications/networking/cluster/nomad/1.4.nix
··· 1 - { callPackage 2 - , buildGoModule 3 - }: 4 - 5 - callPackage ./generic.nix { 6 - inherit buildGoModule; 7 - version = "1.4.3"; 8 - sha256 = "sha256-GQVfrn9VlzfdIj73W3hBpHcevsXZcb6Uj808HUCZUUg="; 9 - vendorSha256 = "sha256-JQRpsQhq5r/QcgFwtnptmvnjBEhdCFrXFrTKkJioL3A="; 10 - }
···
+70
pkgs/applications/networking/cluster/nomad/default.nix
···
··· 1 + { lib 2 + , buildGoModule 3 + , buildGo119Module 4 + , fetchFromGitHub 5 + , nixosTests 6 + }: 7 + 8 + let 9 + generic = 10 + { buildGoModule, version, sha256, vendorSha256, ... }@attrs: 11 + let attrs' = builtins.removeAttrs attrs [ "buildGoModule" "version" "sha256" "vendorSha256" ]; 12 + in 13 + buildGoModule (rec { 14 + pname = "nomad"; 15 + inherit version vendorSha256; 16 + 17 + subPackages = [ "." ]; 18 + 19 + src = fetchFromGitHub { 20 + owner = "hashicorp"; 21 + repo = pname; 22 + rev = "v${version}"; 23 + inherit sha256; 24 + }; 25 + 26 + # ui: 27 + # Nomad release commits include the compiled version of the UI, but the file 28 + # is only included if we build with the ui tag. 29 + tags = [ "ui" ]; 30 + 31 + meta = with lib; { 32 + homepage = "https://www.nomadproject.io/"; 33 + description = "A Distributed, Highly Available, Datacenter-Aware Scheduler"; 34 + platforms = platforms.unix; 35 + license = licenses.mpl20; 36 + maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes maxeaubrey techknowlogick ]; 37 + }; 38 + } // attrs'); 39 + in 40 + rec { 41 + # Nomad never updates major go versions within a release series and is unsupported 42 + # on Go versions that it did not ship with. Due to historic bugs when compiled 43 + # with different versions we pin Go for all versions. 44 + # Upstream partially documents used Go versions here 45 + # https://github.com/hashicorp/nomad/blob/master/contributing/golang.md 46 + 47 + nomad = nomad_1_4; 48 + 49 + nomad_1_2 = generic { 50 + buildGoModule = buildGo119Module; 51 + version = "1.2.15"; 52 + sha256 = "sha256-p9yRjSapQAhuHv+slUmYI25bUb1N1A7LBiJOdk1++iI="; 53 + vendorSha256 = "sha256-6d3tE337zVAIkzQzAnV2Ya5xwwhuzmKgtPUJcJ9HRto="; 54 + }; 55 + 56 + nomad_1_3 = generic { 57 + buildGoModule = buildGo119Module; 58 + version = "1.3.8"; 59 + sha256 = "sha256-hUmDWgGV8HAXew8SpcbhaiaF9VfBN5mk1W7t5lhnZ9I="; 60 + vendorSha256 = "sha256-IfYobyDFriOldJnNfRK0QVKBfttoZZ1iOkt4cBQxd00="; 61 + }; 62 + 63 + nomad_1_4 = generic { 64 + buildGoModule = buildGo119Module; 65 + version = "1.4.3"; 66 + sha256 = "sha256-GQVfrn9VlzfdIj73W3hBpHcevsXZcb6Uj808HUCZUUg="; 67 + vendorSha256 = "sha256-JQRpsQhq5r/QcgFwtnptmvnjBEhdCFrXFrTKkJioL3A="; 68 + passthru.tests.nomad = nixosTests.nomad; 69 + }; 70 + }
-39
pkgs/applications/networking/cluster/nomad/generic.nix
··· 1 - { lib 2 - , buildGoModule 3 - , fetchFromGitHub 4 - , version 5 - , sha256 6 - , vendorSha256 7 - , nixosTests 8 - }: 9 - 10 - buildGoModule rec { 11 - pname = "nomad"; 12 - inherit version; 13 - 14 - subPackages = [ "." ]; 15 - 16 - src = fetchFromGitHub { 17 - owner = "hashicorp"; 18 - repo = pname; 19 - rev = "v${version}"; 20 - inherit sha256; 21 - }; 22 - 23 - inherit vendorSha256; 24 - 25 - # ui: 26 - # Nomad release commits include the compiled version of the UI, but the file 27 - # is only included if we build with the ui tag. 28 - tags = [ "ui" ]; 29 - 30 - passthru.tests.nomad = nixosTests.nomad; 31 - 32 - meta = with lib; { 33 - homepage = "https://www.nomadproject.io/"; 34 - description = "A Distributed, Highly Available, Datacenter-Aware Scheduler"; 35 - platforms = platforms.unix; 36 - license = licenses.mpl20; 37 - maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes maxeaubrey techknowlogick ]; 38 - }; 39 - }
···
+6 -16
pkgs/top-level/all-packages.nix
··· 9790 9791 noip = callPackage ../tools/networking/noip { }; 9792 9793 - nomad = nomad_1_4; 9794 - 9795 - # Nomad never updates major go versions within a release series and is unsupported 9796 - # on Go versions that it did not ship with. Due to historic bugs when compiled 9797 - # with different versions we pin Go for all versions. 9798 - # Upstream partially documents used Go versions here 9799 - # https://github.com/hashicorp/nomad/blob/master/contributing/golang.md 9800 - nomad_1_2 = callPackage ../applications/networking/cluster/nomad/1.2.nix { 9801 - buildGoModule = buildGo119Module; 9802 - }; 9803 - nomad_1_3 = callPackage ../applications/networking/cluster/nomad/1.3.nix { 9804 - buildGoModule = buildGo119Module; 9805 - }; 9806 - nomad_1_4 = callPackage ../applications/networking/cluster/nomad/1.4.nix { 9807 - buildGoModule = buildGo119Module; 9808 - }; 9809 9810 nomad-autoscaler = callPackage ../applications/networking/cluster/nomad-autoscaler { }; 9811
··· 9790 9791 noip = callPackage ../tools/networking/noip { }; 9792 9793 + inherit (callPackage ../applications/networking/cluster/nomad { }) 9794 + nomad 9795 + nomad_1_2 9796 + nomad_1_3 9797 + nomad_1_4 9798 + ; 9799 9800 nomad-autoscaler = callPackage ../applications/networking/cluster/nomad-autoscaler { }; 9801