Replace custom xcaddy with the new one in nixpkgs
This commit is contained in:
parent
7bc3e3bddf
commit
91d56f4b34
2 changed files with 6 additions and 41 deletions
|
@ -1,38 +0,0 @@
|
|||
# copied from here https://github.com/jdheyburn/nixos-configs/blob/932fa64615db39979694c761174ea3b83d4b5e94/modules/caddy/custom-caddy.nix
|
||||
# https://mdleom.com/blog/2021/12/27/caddy-plugins-nixos/#xcaddy
|
||||
|
||||
{ pkgs, plugins, stdenv, lib, ... }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "caddy";
|
||||
# https://github.com/NixOS/nixpkgs/issues/113520
|
||||
version = "2.8.4";
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = with pkgs; [ git go xcaddy ];
|
||||
|
||||
configurePhase = ''
|
||||
export GOCACHE=$TMPDIR/go-cache
|
||||
export GOPATH="$TMPDIR/go"
|
||||
'';
|
||||
|
||||
buildPhase =
|
||||
let
|
||||
pluginArgs =
|
||||
lib.concatMapStringsSep " " (plugin: "--with ${plugin}") plugins;
|
||||
in
|
||||
''
|
||||
runHook preBuild
|
||||
${pkgs.xcaddy}/bin/xcaddy build "v${version}" ${pluginArgs}
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
mv caddy $out/bin
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta.mainProgram = "caddy";
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
, pkgs
|
||||
, inputs
|
||||
, settings
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
|
@ -36,9 +37,11 @@ in
|
|||
enable = true;
|
||||
email = "ssl@catnip.ee";
|
||||
|
||||
package = (pkgs.callPackage ./custom-caddy.nix {
|
||||
plugins = [ "github.com/caddy-dns/cloudflare" ];
|
||||
});
|
||||
package = pkgs.caddy.withPlugins {
|
||||
# https://github.com/NixOS/nixpkgs/pull/358586#issuecomment-2564016652
|
||||
plugins = [ "github.com/caddy-dns/cloudflare@v0.0.0-20240703190432-89f16b99c18e" ];
|
||||
hash = "sha256-JoujVXRXjKUam1Ej3/zKVvF0nX97dUizmISjy3M3Kr8=";
|
||||
};
|
||||
|
||||
globalConfig = ''
|
||||
servers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue