2021-01-25 09:26:54 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
2021-11-29 15:16:25 +01:00
|
|
|
let
|
2021-11-08 22:56:39 +01:00
|
|
|
version = "2.4.6";
|
2021-11-29 15:16:25 +01:00
|
|
|
dist = fetchFromGitHub {
|
|
|
|
owner = "caddyserver";
|
|
|
|
repo = "dist";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-EXs+LNb87RWkmSWvs8nZIVqRJMutn+ntR241gqI7CUg=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildGoModule {
|
|
|
|
pname = "caddy";
|
|
|
|
inherit version;
|
2016-06-05 10:43:36 +02:00
|
|
|
|
2020-05-08 21:23:33 +02:00
|
|
|
subPackages = [ "cmd/caddy" ];
|
2016-08-14 19:55:52 +02:00
|
|
|
|
2016-08-21 17:08:33 +02:00
|
|
|
src = fetchFromGitHub {
|
2019-09-23 05:22:22 +02:00
|
|
|
owner = "caddyserver";
|
2021-11-29 15:16:25 +01:00
|
|
|
repo = "caddy";
|
2016-09-21 18:52:17 +02:00
|
|
|
rev = "v${version}";
|
2021-11-08 22:56:39 +01:00
|
|
|
sha256 = "sha256-xNCxzoNpXkj8WF9+kYJfO18ux8/OhxygkGjA49+Q4vY=";
|
2016-06-05 10:43:36 +02:00
|
|
|
};
|
|
|
|
|
2021-11-08 22:56:39 +01:00
|
|
|
vendorSha256 = "sha256-NomgHqIiugSISbEtvIbJDn5GRn6Dn72adLPkAvLbUQU=";
|
2020-09-25 01:06:45 +02:00
|
|
|
|
2021-11-29 15:16:25 +01: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-25 01:06:45 +02:00
|
|
|
passthru.tests = { inherit (nixosTests) caddy; };
|
2016-08-14 19:55:52 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-12-02 15:18:23 +01:00
|
|
|
homepage = "https://caddyserver.com";
|
2016-09-21 18:52:17 +02:00
|
|
|
description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS";
|
|
|
|
license = licenses.asl20;
|
2020-11-17 12:02:06 +01:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne ];
|
2016-09-21 18:52:17 +02:00
|
|
|
};
|
2020-07-31 05:58:04 +02:00
|
|
|
}
|