Files
Simon Leiner 5b3fb02758 helm-secrets: Fix CLI compatibility with Helm v4
While introducing support for Helm v4, helm-secrets has split
up into multiple plugins [1], with the the v4-compatible
manifest residing at "plugins/helm-secrets-cli/plugin.yaml"
[2] in the source repo, while the manifest in the root
directory [3] is compatible to Helm v3, not v4.

This patch is minimally invasive and only restores the CLI;
getter and post-renderer do not become available through this.

[1]: https://github.com/jkroepke/helm-secrets/wiki/Installation#helm-4
[2]: https://github.com/jkroepke/helm-secrets/blob/main/plugins/helm-secrets-cli/plugin.yaml
[3]: https://github.com/jkroepke/helm-secrets/blob/main/plugin.yaml

Fixes: https://github.com/NixOS/nixpkgs/issues/536239
2026-07-15 13:42:31 +02:00

68 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
coreutils,
findutils,
getopt,
gnugrep,
gnused,
sops,
}:
stdenv.mkDerivation rec {
pname = "helm-secrets";
version = "4.7.6";
src = fetchFromGitHub {
owner = "jkroepke";
repo = "helm-secrets";
rev = "v${version}";
hash = "sha256-gCsXnZCvQqc5PIQGheOdzZ1YSUNDhbMvJIROMGA65Jg=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
getopt
sops
];
# NOTE: helm-secrets is comprised of shell scripts.
dontBuild = true;
# NOTE: Fix version string
postPatch = ''
sed -i 's/^version:.*/version: "${version}"/' plugin.yaml
'';
installPhase = ''
runHook preInstall
install -dm755 $out/helm-secrets $out/helm-secrets/scripts
install -m644 -Dt $out/helm-secrets plugins/helm-secrets-cli/plugin.yaml
cp -r plugins/helm-secrets-cli/scripts/* $out/helm-secrets/scripts
wrapProgram $out/helm-secrets/scripts/run.sh \
--prefix PATH : ${
lib.makeBinPath [
coreutils
findutils
getopt
gnugrep
gnused
sops
]
}
runHook postInstall
'';
meta = {
description = "Helm plugin that helps manage secrets";
homepage = "https://github.com/jkroepke/helm-secrets";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ yurrriq ];
platforms = lib.platforms.unix;
};
}