Created
July 29, 2019 16:49
-
-
Save JakeStanger/0264e45381edce3463ecacc8530e4f7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
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 | |
}; | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://example.com { | |
root /srv/http | |
tls { | |
dns cloudflare | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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