2023-07-30 16:43:27 +00:00
|
|
|
# Adds the Cloudflare DNS validation module
|
|
|
|
|
2023-08-02 15:51:11 +00:00
|
|
|
inputs: _final: prev:
|
|
|
|
|
2023-06-01 03:44:43 +00:00
|
|
|
let
|
2023-08-02 15:51:11 +00:00
|
|
|
|
|
|
|
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
|
|
|
goImports =
|
|
|
|
prev.lib.flip prev.lib.concatMapStrings plugins (pkg: " _ \"${pkg}\"\n");
|
|
|
|
goGets = prev.lib.flip prev.lib.concatMapStrings plugins
|
|
|
|
(pkg: "go get ${pkg}\n ");
|
2023-06-01 03:44:43 +00:00
|
|
|
main = ''
|
|
|
|
package main
|
|
|
|
import (
|
|
|
|
caddycmd "github.com/caddyserver/caddy/v2/cmd"
|
|
|
|
_ "github.com/caddyserver/caddy/v2/modules/standard"
|
2023-06-01 12:18:38 +00:00
|
|
|
${goImports}
|
2023-06-01 03:44:43 +00:00
|
|
|
)
|
|
|
|
func main() {
|
|
|
|
caddycmd.Main()
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2023-08-02 15:51:11 +00:00
|
|
|
in {
|
2024-03-24 17:16:20 +00:00
|
|
|
caddy-cloudflare = prev.buildGo122Module {
|
2023-08-02 15:51:11 +00:00
|
|
|
pname = "caddy-cloudflare";
|
|
|
|
version = prev.caddy.version;
|
|
|
|
runVend = true;
|
|
|
|
|
|
|
|
subPackages = [ "cmd/caddy" ];
|
|
|
|
|
|
|
|
src = prev.caddy.src;
|
|
|
|
|
2024-03-24 18:04:28 +00:00
|
|
|
vendorHash = "sha256-zeuvCk7kZa/W/roC12faCQDav4RB8RT1dR2Suh2yjD8=";
|
2023-06-01 03:44:43 +00:00
|
|
|
|
2023-08-02 15:51:11 +00:00
|
|
|
overrideModAttrs = (_: {
|
|
|
|
preBuild = ''
|
|
|
|
echo '${main}' > cmd/caddy/main.go
|
|
|
|
${goGets}
|
|
|
|
'';
|
|
|
|
postInstall = "cp go.sum go.mod $out/ && ls $out/";
|
|
|
|
});
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-06-01 03:44:43 +00:00
|
|
|
echo '${main}' > cmd/caddy/main.go
|
2023-08-02 15:51:11 +00:00
|
|
|
cat cmd/caddy/main.go
|
2023-06-01 03:44:43 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-02 15:51:11 +00:00
|
|
|
postConfigure = ''
|
|
|
|
cp vendor/go.sum ./
|
|
|
|
cp vendor/go.mod ./
|
|
|
|
'';
|
2023-06-01 03:44:43 +00:00
|
|
|
|
2023-08-02 15:51:11 +00:00
|
|
|
meta = with prev.lib; {
|
|
|
|
homepage = "https://caddyserver.com";
|
|
|
|
description =
|
|
|
|
"Fast, cross-platform HTTP/2 web server with automatic HTTPS";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ Br1ght0ne techknowlogick ];
|
|
|
|
};
|
2023-06-01 03:44:43 +00:00
|
|
|
};
|
|
|
|
}
|