Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 56 lines 1.1 kB view raw
1{ 2 symlinkJoin, 3 lib, 4 makeWrapper, 5 writeText, 6}: 7 8helm: 9 10let 11 wrapper = 12 { 13 plugins ? [ ], 14 extraMakeWrapperArgs ? "", 15 }: 16 let 17 18 initialMakeWrapperArgs = [ 19 ]; 20 21 pluginsDir = symlinkJoin { 22 name = "helm-plugins"; 23 paths = plugins; 24 }; 25 in 26 symlinkJoin { 27 name = "helm-${lib.getVersion helm}"; 28 29 # Remove the symlinks created by symlinkJoin which we need to perform 30 # extra actions upon 31 postBuild = '' 32 wrapProgram "$out/bin/helm" \ 33 "--set" "HELM_PLUGINS" "${pluginsDir}" ${extraMakeWrapperArgs} 34 ''; 35 paths = [ 36 helm 37 pluginsDir 38 ]; 39 40 preferLocalBuild = true; 41 42 nativeBuildInputs = [ makeWrapper ]; 43 passthru = { 44 inherit pluginsDir; 45 unwrapped = helm; 46 }; 47 48 meta = helm.meta // { 49 # To prevent builds on hydra 50 hydraPlatforms = [ ]; 51 # prefer wrapper over the package 52 priority = (helm.meta.priority or lib.meta.defaultPriority) - 1; 53 }; 54 }; 55in 56lib.makeOverridable wrapper