Skip to content

Instantly share code, notes, and snippets.

@Denperidge
Last active March 3, 2024 23:40
Show Gist options
  • Save Denperidge/33808b90cb06128e8b1998804b266801 to your computer and use it in GitHub Desktop.
Save Denperidge/33808b90cb06128e8b1998804b266801 to your computer and use it in GitHub Desktop.
{ pkgs, config, ... }:
with pkgs; stdenv.mkDerivation rec {
pname = "caddy";
version = "2.6.2";
dontUnpack = true;
nativeBuildInputs = [ git go xcaddy ];
configurePhase = ''
export GOCACHE=$TMPDIR/go-cache
export GOPATH="$TMPDIR/go"
'';
buildPhase = ''
runHook preBuild
${xcaddy}/bin/xcaddy build "v${version}" --with github.com/caddy-dns/porkbun
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv caddy $out/bin
runHook postInstall
'';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment