caddy: use nixpkgs caddy.withPlugins helper

This commit is contained in:
ooks-io 2025-01-12 16:42:07 +11:00
parent aa2d8c578e
commit 615cea9f50
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{ {
config, config,
lib, lib,
self', pkgs,
... ...
}: let }: let
inherit (lib) mkIf mkMerge; inherit (lib) mkIf mkMerge;
@ -16,7 +16,13 @@ in {
} }
(mkIf caddy.cloudflare.enable { (mkIf caddy.cloudflare.enable {
package = self'.packages.caddy-with-cloudflare; package = pkgs.caddy.withPlugins {
plugins = [
"github.com/caddy-dns/cloudflare@v0.0.0-20240703190432-89f16b99c18e"
"github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
];
hash = "sha256-X3SNPfianAWLXnE0hpQpgaaCqIqHm0jgyp1clnQKmUg=";
};
globalConfig = '' globalConfig = ''
servers { servers {
metrics metrics

View file

@ -35,7 +35,7 @@ caddy.override {
installPhase = '' installPhase = ''
cp -r --reflink=auto . $out cp -r --reflink=auto . $out
''; '';
outputHash = "sha256-O3QWqgQtLOifsibyB0/UKricEGAx/3NhSjGbgu8+qgY="; outputHash = "sha256-7FlCaHLuyESq+0YAkud7y83hY4oow7omJPTVVweEnJI=";
outputHashMode = "recursive"; outputHashMode = "recursive";
}; };
subPackages = ["."]; subPackages = ["."];
@ -43,4 +43,3 @@ caddy.override {
vendorHash = null; vendorHash = null;
}); });
} }