mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 16:55:38 +00:00
clean up custom caddy build
This commit is contained in:
parent
3269d5e247
commit
6815af21dc
@ -50,11 +50,10 @@ in {
|
||||
}];
|
||||
|
||||
# Tell Caddy to use Cloudflare DNS for ACME challenge validation
|
||||
services.caddy.package =
|
||||
(pkgs.callPackage ../../../overlays/custom-caddy.nix {
|
||||
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
||||
# vendorSha256 = "sha256-K9HPZnr+hMcK5aEd1H4gEg6PXAaNrNWFvaHYm5m62JY=";
|
||||
});
|
||||
services.caddy.package = (pkgs.callPackage ../../../overlays/caddy.nix {
|
||||
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
||||
# vendorSha256 = "sha256-K9HPZnr+hMcK5aEd1H4gEg6PXAaNrNWFvaHYm5m62JY=";
|
||||
});
|
||||
caddy.tlsPolicies = [{
|
||||
issuers = [{
|
||||
module = "acme";
|
||||
|
@ -1,12 +1,13 @@
|
||||
{ lib, buildGo118Module, fetchFromGitHub, plugins ? [ ] }:
|
||||
let
|
||||
imports = lib.flip lib.concatMapStrings plugins (pkg: " _ \"${pkg}\"\n");
|
||||
goImports = lib.flip lib.concatMapStrings plugins (pkg: " _ \"${pkg}\"\n");
|
||||
goGets = lib.flip lib.concatMapStrings plugins (pkg: "go get ${pkg}\n ");
|
||||
main = ''
|
||||
package main
|
||||
import (
|
||||
caddycmd "github.com/caddyserver/caddy/v2/cmd"
|
||||
_ "github.com/caddyserver/caddy/v2/modules/standard"
|
||||
${imports}
|
||||
${goImports}
|
||||
)
|
||||
func main() {
|
||||
caddycmd.Main()
|
||||
@ -31,7 +32,7 @@ in buildGo118Module rec {
|
||||
overrideModAttrs = (_: {
|
||||
preBuild = ''
|
||||
echo '${main}' > cmd/caddy/main.go
|
||||
go get github.com/caddy-dns/cloudflare
|
||||
${goGets}
|
||||
'';
|
||||
postInstall = "cp go.sum go.mod $out/ && ls $out/";
|
||||
});
|
Loading…
Reference in New Issue
Block a user