diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml
index 6121d32346cb6..fb5d475f693ae 100644
--- a/nixos/doc/manual/release-notes/rl-1903.xml
+++ b/nixos/doc/manual/release-notes/rl-1903.xml
@@ -162,6 +162,14 @@
has been renamed to postgresql_9_6.
+
+
+ Package consul-ui and passthrough consul.ui have been removed.
+ The package consul now uses upstream releases that vendor the UI into the binary.
+ See #48714
+ for details.
+
+
Slurm introduces the new option
diff --git a/nixos/modules/services/networking/consul.nix b/nixos/modules/services/networking/consul.nix
index ab3f810376811..0e90fed788b9c 100644
--- a/nixos/modules/services/networking/consul.nix
+++ b/nixos/modules/services/networking/consul.nix
@@ -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;
diff --git a/pkgs/servers/consul/Gemfile b/pkgs/servers/consul/Gemfile
deleted file mode 100644
index 0e782af6b0001..0000000000000
--- a/pkgs/servers/consul/Gemfile
+++ /dev/null
@@ -1,5 +0,0 @@
-# A sample Gemfile
-source "https://rubygems.org"
-
-gem "uglifier"
-gem "sass"
diff --git a/pkgs/servers/consul/Gemfile.lock b/pkgs/servers/consul/Gemfile.lock
deleted file mode 100644
index 60a565f669518..0000000000000
--- a/pkgs/servers/consul/Gemfile.lock
+++ /dev/null
@@ -1,25 +0,0 @@
-GEM
- remote: https://rubygems.org/
- specs:
- execjs (2.7.0)
- ffi (1.9.23)
- rb-fsevent (0.10.3)
- rb-inotify (0.9.10)
- ffi (>= 0.5.0, < 2)
- sass (3.5.6)
- sass-listen (~> 4.0.0)
- sass-listen (4.0.0)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- uglifier (4.1.10)
- execjs (>= 0.3.0, < 3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- sass
- uglifier
-
-BUNDLED WITH
- 1.14.6
diff --git a/pkgs/servers/consul/default.nix b/pkgs/servers/consul/default.nix
index 5cf192791000c..d1dcd78667f03 100644
--- a/pkgs/servers/consul/default.nix
+++ b/pkgs/servers/consul/default.nix
@@ -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=")
'';
@@ -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 ];
};
}
diff --git a/pkgs/servers/consul/gemset.nix b/pkgs/servers/consul/gemset.nix
deleted file mode 100644
index 2a5425ccf5f52..0000000000000
--- a/pkgs/servers/consul/gemset.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- execjs = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1";
- type = "gem";
- };
- version = "2.7.0";
- };
- ffi = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr";
- type = "gem";
- };
- version = "1.9.23";
- };
- rb-fsevent = {
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8";
- type = "gem";
- };
- version = "0.10.3";
- };
- rb-inotify = {
- dependencies = ["ffi"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0yfsgw5n7pkpyky6a9wkf1g9jafxb0ja7gz0qw0y14fd2jnzfh71";
- type = "gem";
- };
- version = "0.9.10";
- };
- sass = {
- dependencies = ["sass-listen"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "19wyzp9qsg8hdkkxlsv713w0qmy66qrdp0shj42587ssx4qhrlag";
- type = "gem";
- };
- version = "3.5.6";
- };
- sass-listen = {
- dependencies = ["rb-fsevent" "rb-inotify"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df";
- type = "gem";
- };
- version = "4.0.0";
- };
- uglifier = {
- dependencies = ["execjs"];
- source = {
- remotes = ["https://rubygems.org"];
- sha256 = "0dycp9c5xiricla6sgvg0vf22i3axs5k1v1607dvl7nv1xkkaczi";
- type = "gem";
- };
- version = "4.1.10";
- };
-}
\ No newline at end of file
diff --git a/pkgs/servers/consul/ui-no-bundle-exec.patch b/pkgs/servers/consul/ui-no-bundle-exec.patch
deleted file mode 100644
index 5707b871049b7..0000000000000
--- a/pkgs/servers/consul/ui-no-bundle-exec.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/ui/scripts/dist.sh b/ui/scripts/dist.sh
-index 0ad6e28e..db340da0 100755
---- a/ui/scripts/dist.sh
-+++ b/ui/scripts/dist.sh
-@@ -15,10 +15,9 @@ DEPLOY="../pkg/web_ui"
- rm -rf $DEPLOY
- mkdir -p $DEPLOY
-
--bundle check >/dev/null 2>&1 || bundle install
--bundle exec sass styles/base.scss static/base.css
-+sass styles/base.scss static/base.css
-
--bundle exec ruby scripts/compile.rb
-+ruby scripts/compile.rb
-
- # Copy into deploy
- shopt -s dotglob
diff --git a/pkgs/servers/consul/ui.nix b/pkgs/servers/consul/ui.nix
deleted file mode 100644
index da9b518bad734..0000000000000
--- a/pkgs/servers/consul/ui.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ stdenv, consul, ruby, bundlerEnv, zip, nodejs }:
-
-let
- # `sass` et al
- gems = bundlerEnv {
- name = "consul-ui-deps";
- gemdir = ./.;
- };
-in
-
-stdenv.mkDerivation {
- name = "consul-ui-${consul.version}";
-
- src = consul.src;
-
- buildInputs = [ ruby gems zip nodejs ];
-
- patches = [ ./ui-no-bundle-exec.patch ];
-
- postPatch = "patchShebangs ./ui/scripts/dist.sh";
-
- buildPhase = ''
- # Build ui static files
- cd ui
- make dist
- '';
-
- installPhase = ''
- # Install ui static files
- mkdir -p $out
- mv ../pkg/web_ui/* $out
- '';
-
- meta = with stdenv.lib; {
- homepage = https://www.consul.io/;
- description = "A tool for service discovery, monitoring and configuration";
- maintainers = with maintainers; [ cstrahan wkennington ];
- license = licenses.mpl20 ;
- platforms = platforms.unix;
- };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 38ade0014b1b0..d647840fc18de 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -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 { };