3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/caddy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
let
2022-04-25 18:42:40 +01:00
version = "2.5.0";
dist = fetchFromGitHub {
owner = "caddyserver";
repo = "dist";
rev = "v${version}";
sha256 = "sha256-EXs+LNb87RWkmSWvs8nZIVqRJMutn+ntR241gqI7CUg=";
};
in
buildGoModule {
pname = "caddy";
inherit version;
2016-06-05 09:43:36 +01:00
subPackages = [ "cmd/caddy" ];
2016-08-21 16:08:33 +01:00
src = fetchFromGitHub {
2019-09-23 04:22:22 +01:00
owner = "caddyserver";
repo = "caddy";
2016-09-21 17:52:17 +01:00
rev = "v${version}";
2022-04-25 18:42:40 +01:00
sha256 = "sha256-V9iIz/93n6EBJZ9v3MDKD6FivtplRFN9a/e0o7YX0/w=";
2016-06-05 09:43:36 +01:00
};
2022-04-25 18:42:40 +01:00
vendorSha256 = "sha256-xu3klc9yb4Ws8fvXRV286IDhi/zQVN1PKCiFKb8VJBo=";
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"
'';
passthru.tests = { inherit (nixosTests) caddy; };
meta = with lib; {
2019-12-02 14:18:23 +00:00
homepage = "https://caddyserver.com";
2016-09-21 17:52:17 +01:00
description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS";
license = licenses.asl20;
2022-04-25 18:42:40 +01:00
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
2016-09-21 17:52:17 +01:00
};
}