mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
caddy: 2.8.4 -> 2.9.0
This commit is contained in:
parent
07fd500b5a
commit
7c52e7a08b
1 changed files with 46 additions and 35 deletions
|
@ -1,20 +1,21 @@
|
||||||
{ lib
|
{
|
||||||
, buildGoModule
|
lib,
|
||||||
, callPackage
|
buildGoModule,
|
||||||
, fetchFromGitHub
|
callPackage,
|
||||||
, nixosTests
|
fetchFromGitHub,
|
||||||
, caddy
|
nixosTests,
|
||||||
, testers
|
caddy,
|
||||||
, installShellFiles
|
testers,
|
||||||
, stdenv
|
installShellFiles,
|
||||||
|
stdenv,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
version = "2.8.4";
|
version = "2.9.0";
|
||||||
dist = fetchFromGitHub {
|
dist = fetchFromGitHub {
|
||||||
owner = "caddyserver";
|
owner = "caddyserver";
|
||||||
repo = "dist";
|
repo = "dist";
|
||||||
rev = "v${version}";
|
tag = "v${version}";
|
||||||
hash = "sha256-O4s7PhSUTXoNEIi+zYASx8AgClMC5rs7se863G6w+l0=";
|
hash = "sha256-3QcpmPUhZZ8oN/CUbCh/A1D0B59o1RxWPyMbA/WoRcU=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
|
@ -24,11 +25,11 @@ buildGoModule {
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "caddyserver";
|
owner = "caddyserver";
|
||||||
repo = "caddy";
|
repo = "caddy";
|
||||||
rev = "v${version}";
|
tag = "v${version}";
|
||||||
hash = "sha256-CBfyqtWp3gYsYwaIxbfXO3AYaBiM7LutLC7uZgYXfkQ=";
|
hash = "sha256-ea1Cch0LOGVGO9CVvS61EHVwJule4HZRizpQYP1QA2w=";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorHash = "sha256-1Api8bBZJ1/oYk4ZGIiwWCSraLzK9L+hsKXkFtk6iVM=";
|
vendorHash = "sha256-HEQCNOv4vO5QsbmoT0acRoaJ4sB0dzF1zcR38778nBI=";
|
||||||
|
|
||||||
subPackages = [ "cmd/caddy" ];
|
subPackages = [ "cmd/caddy" ];
|
||||||
|
|
||||||
|
@ -39,29 +40,35 @@ buildGoModule {
|
||||||
];
|
];
|
||||||
|
|
||||||
# matches upstream since v2.8.0
|
# matches upstream since v2.8.0
|
||||||
tags = [ "nobadger" ];
|
tags = [
|
||||||
|
"nobadger"
|
||||||
|
"nomysql"
|
||||||
|
"nopgx"
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall =
|
||||||
install -Dm644 ${dist}/init/caddy.service ${dist}/init/caddy-api.service -t $out/lib/systemd/system
|
''
|
||||||
|
install -Dm644 ${dist}/init/caddy.service ${dist}/init/caddy-api.service -t $out/lib/systemd/system
|
||||||
|
|
||||||
substituteInPlace $out/lib/systemd/system/caddy.service \
|
substituteInPlace $out/lib/systemd/system/caddy.service \
|
||||||
--replace-fail "/usr/bin/caddy" "$out/bin/caddy"
|
--replace-fail "/usr/bin/caddy" "$out/bin/caddy"
|
||||||
substituteInPlace $out/lib/systemd/system/caddy-api.service \
|
substituteInPlace $out/lib/systemd/system/caddy-api.service \
|
||||||
--replace-fail "/usr/bin/caddy" "$out/bin/caddy"
|
--replace-fail "/usr/bin/caddy" "$out/bin/caddy"
|
||||||
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
''
|
||||||
# Generating man pages and completions fail on cross-compilation
|
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
# https://github.com/NixOS/nixpkgs/issues/308283
|
# Generating man pages and completions fail on cross-compilation
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/308283
|
||||||
|
|
||||||
$out/bin/caddy manpage --directory manpages
|
$out/bin/caddy manpage --directory manpages
|
||||||
installManPage manpages/*
|
installManPage manpages/*
|
||||||
|
|
||||||
installShellCompletion --cmd caddy \
|
installShellCompletion --cmd caddy \
|
||||||
--bash <($out/bin/caddy completion bash) \
|
--bash <($out/bin/caddy completion bash) \
|
||||||
--fish <($out/bin/caddy completion fish) \
|
--fish <($out/bin/caddy completion fish) \
|
||||||
--zsh <($out/bin/caddy completion zsh)
|
--zsh <($out/bin/caddy completion zsh)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
tests = {
|
tests = {
|
||||||
|
@ -74,11 +81,15 @@ buildGoModule {
|
||||||
withPlugins = callPackage ./plugins.nix { inherit caddy; };
|
withPlugins = callPackage ./plugins.nix { inherit caddy; };
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = {
|
||||||
homepage = "https://caddyserver.com";
|
homepage = "https://caddyserver.com";
|
||||||
description = "Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS";
|
description = "Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS";
|
||||||
license = licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
mainProgram = "caddy";
|
mainProgram = "caddy";
|
||||||
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
|
maintainers = with lib.maintainers; [
|
||||||
|
Br1ght0ne
|
||||||
|
stepbrobd
|
||||||
|
techknowlogick
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue