Skip to content

Commit

Permalink
consul: 0.9.3 -> 1.3.0.
Browse files Browse the repository at this point in the history
Removes the old UI build tooling; it is no longer necessary
because as of 1.2.0 it's bundled into the server binary.
It doesn't even need to have JS built, because it's bundled into
the release commit's source tree (see NixOS#48714).

The UI is enabled by default, so the NixOS service is
updated to directly use `ui = webUi;` now.

Fixes NixOS#48714.
Fixes NixOS#44192.
Fixes NixOS#41243.
Fixes NixOS#35602.

Signed-off-by: Niklas Hambüchen <[email protected]>
  • Loading branch information
nh2 committed Nov 3, 2018
1 parent df28b4b commit 2cb7f5f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 162 deletions.
7 changes: 4 additions & 3 deletions nixos/modules/services/networking/consul.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ let
dataDir = "/var/lib/consul";
cfg = config.services.consul;

configOptions = { data_dir = dataDir; } //
(if cfg.webUi then { ui_dir = "${cfg.package.ui}"; } else { }) //
cfg.extraConfig;
configOptions = {
data_dir = dataDir;
ui = cfg.webUi;
} // cfg.extraConfig;

configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
++ cfg.extraConfigFiles;
Expand Down
5 changes: 0 additions & 5 deletions pkgs/servers/consul/Gemfile

This file was deleted.

25 changes: 0 additions & 25 deletions pkgs/servers/consul/Gemfile.lock

This file was deleted.

19 changes: 12 additions & 7 deletions pkgs/servers/consul/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
{ stdenv, buildGoPackage, consul-ui, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
name = "consul-${version}";
version = "0.9.3";
version = "1.3.0";
rev = "v${version}";

goPackagePath = "github.com/hashicorp/consul";

# Note: Currently only release tags are supported, because they have the Consul UI
# vendored. See
# https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834
# If you want to use a non-release commit as `src`, you probably want to improve
# this derivation so that it can build the UI's JavaScript from source.
# See https://github.com/NixOS/nixpkgs/pull/49082 for something like that.
# Or, if you want to patch something that doesn't touch the UI, you may want
# to apply your changes as patches on top of a release commit.
src = fetchFromGitHub {
owner = "hashicorp";
repo = "consul";
inherit rev;
sha256 = "1176frp7kimpycsmz9wrbizf46jgxr8jq7hz5w4q1x90lswvrxv3";
sha256 = "1zv84snvrjm74w3v3rr27linsbxj00m73xd047sb78a4766xs2h0";
};

# Keep consul.ui for backward compatability
passthru.ui = consul-ui;

preBuild = ''
buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=")
'';
Expand All @@ -26,6 +31,6 @@ buildGoPackage rec {
homepage = https://www.consul.io/;
platforms = platforms.linux ++ platforms.darwin;
license = licenses.mpl20;
maintainers = with maintainers; [ pradeepchhetri ];
maintainers = with maintainers; [ pradeepchhetri vdemeester nh2 ];
};
}
62 changes: 0 additions & 62 deletions pkgs/servers/consul/gemset.nix

This file was deleted.

17 changes: 0 additions & 17 deletions pkgs/servers/consul/ui-no-bundle-exec.patch

This file was deleted.

41 changes: 0 additions & 41 deletions pkgs/servers/consul/ui.nix

This file was deleted.

2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,6 @@ with pkgs;

consul = callPackage ../servers/consul { };

consul-ui = callPackage ../servers/consul/ui.nix { };

consul-alerts = callPackage ../servers/monitoring/consul-alerts { };

consul-template = callPackage ../tools/system/consul-template { };
Expand Down

0 comments on commit 2cb7f5f

Please sign in to comment.