Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions pkgs/build-support/fetchtraefikplugin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
lib,
fetchzip,
traefik,
}:

lib.extendMkDerivation {
constructDrv = fetchzip;
extendDrvArgs =
finalAttrs:
{
plugin,
owner,
provider ? "github.com", # Most Traefik plugins are developed in GitHub repositories.

version,
hash,

pname ? plugin,
name ? "${pname}-${version}",
meta ? { },
}:
let
moduleName = lib.concatStringsSep "/" [
provider
owner
plugin
];
in
{
inherit
hash
name
;

url = "https://plugins.traefik.io/public/download/${moduleName}/${version}";
postFetch = ''
export tmpdir=$(mktemp -d)
mv -R * .* $tmpdir
mkdir -p $out/src/${moduleName}
mv -R $tmpdir/* $tmpdir/.* $out/src/${moduleName}
'';

passthru = {
inherit
moduleName
plugin
provider
owner
;
};

meta = {
homepage = "https://plugins.traefik.io/plugins";
inherit (traefik) platforms;
}
// meta;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,8 @@ with pkgs;

fetchPypiLegacy = callPackage ../build-support/fetchpypilegacy { };

fetchTraefikPlugin = callPackage ../build-support/fetchtraefikplugin { };

resolveMirrorURLs =
{ url }:
fetchurl {
Expand Down
Loading