2021-01-25 08:26:54 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
2021-11-29 14:16:25 +00:00
|
|
|
let
|
2022-09-20 19:02:39 +00:00
|
|
|
version = "2.6.0";
|
2021-11-29 14:16:25 +00:00
|
|
|
dist = fetchFromGitHub {
|
|
|
|
owner = "caddyserver";
|
|
|
|
repo = "dist";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-EXs+LNb87RWkmSWvs8nZIVqRJMutn+ntR241gqI7CUg=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildGoModule {
|
|
|
|
pname = "caddy";
|
|
|
|
inherit version;
|
2016-06-05 08:43:36 +00:00
|
|
|
|
2020-05-08 19:23:33 +00:00
|
|
|
subPackages = [ "cmd/caddy" ];
|
2016-08-14 17:55:52 +00:00
|
|
|
|
2016-08-21 15:08:33 +00:00
|
|
|
src = fetchFromGitHub {
|
2019-09-23 03:22:22 +00:00
|
|
|
owner = "caddyserver";
|
2021-11-29 14:16:25 +00:00
|
|
|
repo = "caddy";
|
2016-09-21 16:52:17 +00:00
|
|
|
rev = "v${version}";
|
2022-09-20 19:02:39 +00:00
|
|
|
sha256 = "sha256-BZGfYpQM5e+/LrGqs1oms/vOp9q4UY/ZyDODEsi/wl8=";
|
2016-06-05 08:43:36 +00:00
|
|
|
};
|
|
|
|
|
2022-09-20 19:02:39 +00:00
|
|
|
vendorSha256 = "sha256-6UTErIPB/z4RfndPSLKFJDFweLB3ax8WxEDA+3G5asI=";
|
2020-09-24 23:06:45 +00:00
|
|
|
|
2021-11-29 14:16:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 ${dist}/init/caddy.service ${dist}/init/caddy-api.service -t $out/lib/systemd/system
|
|
|
|
|
|
|
|
substituteInPlace $out/lib/systemd/system/caddy.service --replace "/usr/bin/caddy" "$out/bin/caddy"
|
|
|
|
substituteInPlace $out/lib/systemd/system/caddy-api.service --replace "/usr/bin/caddy" "$out/bin/caddy"
|
|
|
|
'';
|
|
|
|
|
2020-09-24 23:06:45 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) caddy; };
|
2016-08-14 17:55:52 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-12-02 14:18:23 +00:00
|
|
|
homepage = "https://caddyserver.com";
|
2016-09-21 16:52:17 +00:00
|
|
|
description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS";
|
|
|
|
license = licenses.asl20;
|
2022-04-25 17:42:40 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
|
2016-09-21 16:52:17 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|