1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

chore: remove caddy

This commit is contained in:
oddlama 2024-11-13 19:49:53 +01:00
parent dee73f191d
commit 8938d78305
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
2 changed files with 0 additions and 49 deletions

View file

@ -1,48 +0,0 @@
_final: prev: let
inherit
(prev.lib)
escapeShellArg
concatMapStrings
flip
;
make-custom-caddy = {
plugins,
vendorHash,
}: let
caddyPatchMain =
flip concatMapStrings plugins
({name, ...}: "sed -i '/plug in Caddy modules here/a \\\\t_ \"${name}\"' cmd/caddy/main.go\n");
caddyPatchGoGet =
flip concatMapStrings plugins
({
name,
version,
}: "go get ${escapeShellArg name}@${escapeShellArg version}\n");
in
prev.caddy.override {
buildGoModule = args:
prev.buildGoModule (args
// {
inherit vendorHash;
passthru.plugins = plugins;
overrideModAttrs = _: {
preBuild = caddyPatchGoGet;
postInstall = "cp go.mod go.sum $out/";
};
postPatch = caddyPatchMain;
postConfigure = "cp vendor/go.mod vendor/go.sum .";
});
};
in {
# Example usage:
# caddy.withPackages {
# plugins = [
# { name = "github.com/greenpau/caddy-security"; version = "v1.1.18"; }
# ];
# vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
# }
caddy = prev.caddy.overrideAttrs (_: {passthru.withPackages = make-custom-caddy;});
}

View file

@ -1,5 +1,4 @@
_inputs: [
(import ./caddy.nix)
(import ./scripts)
(_final: prev: {
deploy = prev.callPackage ./deploy.nix {};