Skip to content

Instantly share code, notes, and snippets.

@JakeStanger
Created July 29, 2019 16:49
Show Gist options
  • Save JakeStanger/0264e45381edce3463ecacc8530e4f7d to your computer and use it in GitHub Desktop.
Save JakeStanger/0264e45381edce3463ecacc8530e4f7d to your computer and use it in GitHub Desktop.
[
{
goPackagePath = "github.com/caddyserver/dnsproviders/cloudflare";
fetch = {
type = "git";
url = "https://github.com/caddyserver/dnsproviders";
rev = "272452b36c2f962599ed59085829141bfc742d87";
sha256 = "163cpzam39zdc6bv7iz1a4w4lwayrq3krbfr6lncnsrqqknp5pvn"; # This should be the right sha256
};
}
]
http://example.com {
root /srv/http
tls {
dns cloudflare
}
}
{ config, pkgs, ... }:
let
caddyCloudflare = pkgs.caddy.overrideDerivation (oldAttrs: {
name = "caddy-cloudflare-${oldAttrs.version}";
preConfigure = ''
substituteInPlace ./caddy/caddymain/run.go \
--replace '// This is where other plugins get plugged in (imported)' \
'_ "github.com/caddyserver/dnsproviders/cloudflare"'
'';
goDeps = ./caddy-deps.nix;
});
in
{
caddy = {
enable = true;
ca = "https://acme-staging-v02.api.letsencrypt.org/directory"; # Use staging cert api
config = builtins.readFile ./Caddyfile;
package = caddyCloudflare;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment