From 3fa125ba769be3e071a5b30c83c0999dcf698793 Mon Sep 17 00:00:00 2001 From: "Maxine E. Aubrey" Date: Wed, 12 Aug 2020 23:58:18 +0200 Subject: [PATCH] nomad: restructure to use multiple files as per request in PR comments, used generic.nix with version files --- .../networking/cluster/nomad/0.11.nix | 6 ++++++ .../networking/cluster/nomad/0.12.nix | 6 ++++++ .../cluster/nomad/{default.nix => generic.nix} | 17 +---------------- pkgs/top-level/all-packages.nix | 4 ++-- 4 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 pkgs/applications/networking/cluster/nomad/0.11.nix create mode 100644 pkgs/applications/networking/cluster/nomad/0.12.nix rename pkgs/applications/networking/cluster/nomad/{default.nix => generic.nix} (74%) diff --git a/pkgs/applications/networking/cluster/nomad/0.11.nix b/pkgs/applications/networking/cluster/nomad/0.11.nix new file mode 100644 index 000000000000..9d0f2248ddc5 --- /dev/null +++ b/pkgs/applications/networking/cluster/nomad/0.11.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +callPackage ./generic.nix { + version = "0.11.4"; + sha256 = "1sykp9sji6f564s7bz0cvnr9w5x92n0l1r1djf1bl7jvv2mi1mcb"; +} diff --git a/pkgs/applications/networking/cluster/nomad/0.12.nix b/pkgs/applications/networking/cluster/nomad/0.12.nix new file mode 100644 index 000000000000..ae131702df6e --- /dev/null +++ b/pkgs/applications/networking/cluster/nomad/0.12.nix @@ -0,0 +1,6 @@ +{ callPackage }: + +callPackage ./generic.nix { + version = "0.12.2"; + sha256 = "1gc286ag6plk5kxw7jzr32cp3n5rwydj1z7rds1rfd0fyq7an404"; +} diff --git a/pkgs/applications/networking/cluster/nomad/default.nix b/pkgs/applications/networking/cluster/nomad/generic.nix similarity index 74% rename from pkgs/applications/networking/cluster/nomad/default.nix rename to pkgs/applications/networking/cluster/nomad/generic.nix index 1d3b8e32ba3f..0bfdb0b27f6e 100644 --- a/pkgs/applications/networking/cluster/nomad/default.nix +++ b/pkgs/applications/networking/cluster/nomad/generic.nix @@ -1,19 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, majorVersion ? "0.11" }: - -let - versionMap = { - "0.11" = { - version = "0.11.4"; - sha256 = "1sykp9sji6f564s7bz0cvnr9w5x92n0l1r1djf1bl7jvv2mi1mcb"; - }; - "0.12" = { - version = "0.12.2"; - sha256 = "1gc286ag6plk5kxw7jzr32cp3n5rwydj1z7rds1rfd0fyq7an404"; - }; - }; -in - -with versionMap.${majorVersion}; +{ stdenv, buildGoPackage, fetchFromGitHub, version, sha256 }: buildGoPackage rec { pname = "nomad"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b58f7864b753..854aca3a622c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5609,8 +5609,8 @@ in noip = callPackage ../tools/networking/noip { }; nomad = nomad_0_11; - nomad_0_11 = callPackage ../applications/networking/cluster/nomad { majorVersion = "0.11"; }; - nomad_0_12 = callPackage ../applications/networking/cluster/nomad { majorVersion = "0.12"; }; + nomad_0_11 = callPackage ../applications/networking/cluster/nomad/0.11.nix { }; + nomad_0_12 = callPackage ../applications/networking/cluster/nomad/0.12.nix { }; notable = callPackage ../applications/misc/notable { };