From 6322325a53cc7c681992fe5899fbfaf4f007957f Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Fri, 8 May 2020 22:23:33 +0300 Subject: [PATCH] caddy: 1.0.5 -> 2.0.0 Rename legacy v1 to `caddy1` --- nixos/modules/services/web-servers/caddy.nix | 8 ++--- pkgs/servers/caddy/default.nix | 22 ++++-------- pkgs/servers/caddy/v1.nix | 36 ++++++++++++++++++++ pkgs/servers/caddy/v2.nix | 26 -------------- pkgs/top-level/all-packages.nix | 8 ++--- 5 files changed, 48 insertions(+), 52 deletions(-) create mode 100644 pkgs/servers/caddy/v1.nix delete mode 100644 pkgs/servers/caddy/v2.nix diff --git a/nixos/modules/services/web-servers/caddy.nix b/nixos/modules/services/web-servers/caddy.nix index 65e9f12e6648..e5f1df774bbc 100644 --- a/nixos/modules/services/web-servers/caddy.nix +++ b/nixos/modules/services/web-servers/caddy.nix @@ -86,13 +86,13 @@ in { }; package = mkOption { - default = pkgs.caddy2; - defaultText = "pkgs.caddy2"; - example = "pkgs.caddy"; + default = pkgs.caddy; + defaultText = "pkgs.caddy"; + example = "pkgs.caddy1"; type = types.package; description = '' Caddy package to use. - To use Caddy v1 (obsolete), set this to . + To use Caddy v1 (obsolete), set this to pkgs.caddy1. ''; }; }; diff --git a/pkgs/servers/caddy/default.nix b/pkgs/servers/caddy/default.nix index 05b69c30e6ce..5a7ac8f086f9 100644 --- a/pkgs/servers/caddy/default.nix +++ b/pkgs/servers/caddy/default.nix @@ -2,35 +2,25 @@ buildGoModule rec { pname = "caddy"; - version = "1.0.5"; + version = "2.0.0"; - subPackages = [ "caddy" ]; + subPackages = [ "cmd/caddy" ]; src = fetchFromGitHub { owner = "caddyserver"; repo = pname; rev = "v${version}"; - sha256 = "0jrhwmr6gggppskg5h450wybzkv17iq69dgw36hd1dp56q002i7g"; + sha256 = "1c1frfx0qkprhf4var70cncvrw8s9gjag2hygndbd9055hb52bvv"; }; + vendorSha256 = "09vnci9pp8zp7bvn8zj68wslz2nc54nhcd0ll31sqfjbp00215mj"; - doCheck = false; - - preBuild = '' - cat << EOF > caddy/main.go - package main - import "github.com/caddyserver/caddy/caddy/caddymain" - func main() { - caddymain.EnableTelemetry = false - caddymain.Run() - } - EOF - ''; + modSha256 = "19sxyvfq1bpg85w8cd1yk2s6rd8759cf2zqs5b6wyny4cak2bl83"; meta = with stdenv.lib; { homepage = "https://caddyserver.com"; description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS"; license = licenses.asl20; - maintainers = with maintainers; [ rushmorem fpletz zimbatm filalex77 ]; + maintainers = with maintainers; [ filalex77 ]; }; } diff --git a/pkgs/servers/caddy/v1.nix b/pkgs/servers/caddy/v1.nix new file mode 100644 index 000000000000..bcd4b7065b58 --- /dev/null +++ b/pkgs/servers/caddy/v1.nix @@ -0,0 +1,36 @@ +{ stdenv, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "caddy"; + version = "1.0.5"; + + goPackagePath = "github.com/caddyserver/caddy"; + + subPackages = [ "caddy" ]; + + src = fetchFromGitHub { + owner = "caddyserver"; + repo = pname; + rev = "v${version}"; + sha256 = "0jrhwmr6gggppskg5h450wybzkv17iq69dgw36hd1dp56q002i7g"; + }; + modSha256 = "1gc0xvsihr4zp7hkrdfrplvzkaphz1y4q53rgwn2jhd8s98l57an"; + + preBuild = '' + cat << EOF > caddy/main.go + package main + import "github.com/caddyserver/caddy/caddy/caddymain" + func main() { + caddymain.EnableTelemetry = false + caddymain.Run() + } + EOF + ''; + + meta = with stdenv.lib; { + homepage = "https://caddyserver.com"; + description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS"; + license = licenses.asl20; + maintainers = with maintainers; [ rushmorem fpletz zimbatm filalex77 ]; + }; +} diff --git a/pkgs/servers/caddy/v2.nix b/pkgs/servers/caddy/v2.nix deleted file mode 100644 index 4021e8298003..000000000000 --- a/pkgs/servers/caddy/v2.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ stdenv, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "caddy"; - version = "2.1.1"; - - subPackages = [ "cmd/caddy" ]; - - src = fetchFromGitHub { - owner = "caddyserver"; - repo = pname; - rev = "v${version}"; - sha256 = "0c682zrivkawsxlps5hlx8js5zp4ddahg0zi5cr0861gnllbdll0"; - }; - - vendorSha256 = "0jzx00c2b8y7zwl73r2fh1826spcd15y39nfzr53s5lay3fvkybc"; - - doCheck = false; - - meta = with stdenv.lib; { - homepage = "https://caddyserver.com"; - description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS"; - license = licenses.asl20; - maintainers = with maintainers; [ filalex77 ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7a5414477e9d..dba9d0c793b7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1507,12 +1507,8 @@ in ''; }); - caddy = callPackage ../servers/caddy { - buildGoModule = buildGo114Module; - }; - caddy2 = callPackage ../servers/caddy/v2.nix { - buildGoModule = buildGo114Module; - }; + caddy = callPackage ../servers/caddy { }; + caddy1 = callPackage ../servers/caddy/v1.nix { }; traefik = callPackage ../servers/traefik { }; calamares = libsForQt5.callPackage ../tools/misc/calamares {