blob: 3b13668abf6823673b04885d30840d92dea9ce45 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
{ symlinkJoin, lib, makeWrapper, writeText }:
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 = ''
wrapProgram "$out/bin/helm" \
"--set" "HELM_PLUGINS" "${pluginsDir}" ${extraMakeWrapperArgs}
'';
paths = [ helm pluginsDir ];
preferLocalBuild = true;
nativeBuildInputs = [ makeWrapper ];
passthru = {
inherit pluginsDir;
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
|