website: caddy cloudflare package
This commit is contained in:
parent
c096dc295a
commit
a9ef09a8a4
5 changed files with 95 additions and 25 deletions
46
outputs/pkgs/caddy-with-cloudflare/default.nix
Normal file
46
outputs/pkgs/caddy-with-cloudflare/default.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
buildGoModule,
|
||||
cacert,
|
||||
go,
|
||||
lib,
|
||||
stdenv,
|
||||
xcaddy,
|
||||
caddy,
|
||||
}:
|
||||
caddy.override {
|
||||
buildGoModule = args:
|
||||
buildGoModule (args
|
||||
// {
|
||||
src = stdenv.mkDerivation rec {
|
||||
pname = "caddy-using-xcaddy-${xcaddy.version}";
|
||||
inherit (caddy) version;
|
||||
dontUnpack = true;
|
||||
dontFixup = true;
|
||||
nativeBuildInputs = [cacert go];
|
||||
plugins = [
|
||||
"github.com/WeidiDeng/caddy-cloudflare-ip"
|
||||
];
|
||||
configurePhase = ''
|
||||
export GOCACHE=$TMPDIR/go-cache
|
||||
export GOPATH="$TMPDIR/go"
|
||||
export XCADDY_SKIP_BUILD=1
|
||||
'';
|
||||
buildPhase = ''
|
||||
${xcaddy}/bin/xcaddy build "${caddy.src.rev}" ${
|
||||
lib.concatMapStringsSep " " (plugin: "--with ${plugin}") plugins
|
||||
}
|
||||
cd buildenv*
|
||||
go mod vendor
|
||||
'';
|
||||
installPhase = ''
|
||||
cp -r --reflink=auto . $out
|
||||
'';
|
||||
outputHash = "sha256-O3QWqgQtLOifsibyB0/UKricEGAx/3NhSjGbgu8+qgY=";
|
||||
outputHashMode = "recursive";
|
||||
};
|
||||
subPackages = ["."];
|
||||
ldflags = ["-s" "-w"];
|
||||
vendorHash = null;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
repopack = callPackage ./repopack {};
|
||||
live-buds-cli = callPackage ./live-buds-cli {};
|
||||
website = callPackage ./website {};
|
||||
caddy-with-cloudflare = callPackage ./caddy-with-cloudflare {};
|
||||
|
||||
ook-vim = mkNeovim pkgs [ook-vim-config];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue