2021-03-26 05:13:53 +00:00
|
|
|
{ symlinkJoin, lib, makeWrapper, writeText }:
|
2020-12-14 12:03:32 +00:00
|
|
|
|
|
|
|
helm:
|
|
|
|
|
|
|
|
let
|
|
|
|
wrapper = {
|
|
|
|
plugins ? [],
|
|
|
|
extraMakeWrapperArgs ? ""
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
|
|
|
|
initialMakeWrapperArgs = [
|
|
|
|
];
|
|
|
|
|
|
|
|
pluginsDir = symlinkJoin {
|
|
|
|
name = "helm-plugins";
|
|
|
|
paths = plugins;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
symlinkJoin {
|
|
|
|
name = "helm-${lib.getVersion helm}";
|
|
|
|
|
|
|
|
# Remove the symlinks created by symlinkJoin which we need to perform
|
|
|
|
# extra actions upon
|
|
|
|
postBuild = ''
|
2021-08-18 10:56:54 +00:00
|
|
|
wrapProgram "$out/bin/helm" \
|
2021-08-02 21:26:41 +00:00
|
|
|
"--set" "HELM_PLUGINS" "${pluginsDir}" ${extraMakeWrapperArgs}
|
2020-12-14 12:03:32 +00:00
|
|
|
'';
|
|
|
|
paths = [ helm pluginsDir ];
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
passthru = { unwrapped = helm; };
|
|
|
|
|
|
|
|
meta = helm.meta // {
|
|
|
|
# To prevent builds on hydra
|
|
|
|
hydraPlatforms = [];
|
|
|
|
# prefer wrapper over the package
|
|
|
|
priority = (helm.meta.priority or 0) - 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.makeOverridable wrapper
|