# Helm plugin install

**URL:** https://discourse.nixos.org/t/helm-plugin-install/20705
**Category:** Help
**Created:** [August 1, 2022, 10:30pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705 "2022-08-01T22:30:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jordangarrison](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jordangarrison/32/6366_2.png) [@jordangarrison](https://discourse.nixos.org/u/jordangarrison)
#### Post date: [August 1, 2022, 10:30pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/1 "2022-08-01T22:30:38Z")

</div>

Hi NixOs community,

I have a short and sweet question around getting helm (the Kubernetes package manager) plugins to work. Plugins are built into the utility but trying to install them leads to permission errors since the package is installed via nix and the directory is read-only. Has anyone had any luck installing helm plugins?

Here is the `shell.nix` file I’ve been working with:

```nix
let pkgs = import <nixpkgs> { };
in
pkgs.mkShell rec {
  name = "kube-state-metrics-deployment";

  buildInputs = with pkgs; [
    # External Dependencies
    curl
    docker
    git
    kubectl
    kubernetes-helm-wrapped
    kustomize
    jq
    openssh
  ];

  shellHook = ''
    helm plugin install https://github.com/databus23/helm-diff
  '';
}

```

I’ve tried the shellHook but this is a post-install step so it faces the same permissions issues. I’m tempted to just create a docker image and remote dev this but hopefully, it won’t come to that.

---

<div class="post-metadata">

### Author: ![smf](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@smf](https://discourse.nixos.org/u/smf)
#### Post date: [August 2, 2022, 5:28pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/2 "2022-08-02T17:28:57Z")

</div>

Hi @jordangarrison -

I managed to install the secrets plugin using

`pkgs.wrapHelm pkgs.kubernetes-helm { plugins = [pkgs.kubernetes-helmPlugins.helm-secrets]; }`

I’m pretty sure you can do something like

`pkgs.wrapHelm pkgs.kubernetes-helm { plugins = [pkgs.kubernetes-helmPlugins.helm-diff]; }`

to get the plugin you want installed. There’s probably a better way, but this worked for me.

Alex

---

<div class="post-metadata">

### Author: ![Sandro](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sandro/32/2865_2.png) [@Sandro](https://discourse.nixos.org/u/Sandro)
#### Post date: [August 3, 2022, 11:40am UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/3 "2022-08-03T11:40:50Z")

</div>

Did you try running `helm plugin install` in a normal login shell?

---

<div class="post-metadata">

### Author: ![jordangarrison](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jordangarrison/32/6366_2.png) [@jordangarrison](https://discourse.nixos.org/u/jordangarrison)
#### Post date: [August 9, 2022, 2:26pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/4 "2022-08-09T14:26:58Z")

</div>

Hi Alex (@smf),

I’m slowly getting my bearings with setting up these shell nix files as I move in to each new repository I work in. Where would the line

```nix
pkgs.wrapHelm pkgs.kubernetes-helm { plugins = [pkgs.kubernetes-helmPlugins.helm-secrets]; }

```

live inside of this `shell.nix`?

```nix
let pkgs = import <nixpkgs> { };
in
pkgs.mkShell rec {
  name = "kube-state-metrics-deployment";

  buildInputs = with pkgs; [
    # External Dependencies
    curl
    docker
    git
    kubectl
    kubernetes-helm-wrapped
    kustomize
    jq
    openssh
  ];
}

```

I attempted to put it in the `buildInputs` but received errors.

Thanks a ton for your help and aplogies for my delay in responding to your answer.

Best,  
Jordan

---

<div class="post-metadata">

### Author: ![jordangarrison](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jordangarrison/32/6366_2.png) [@jordangarrison](https://discourse.nixos.org/u/jordangarrison)
#### Post date: [August 9, 2022, 2:57pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/5 "2022-08-09T14:57:57Z")

</div>

Hi @Sandro,

I haven’t tried that yet, I was hoping to not install helm globally. I was trying to install it in the specific repo’s `shell.nix`. I use a couple systems and have `direnv` set up to autoload these when I enter the directories for the repository.

I can give it a whirl with the global setup to see if it works outside of the repo-specific nix-shell. But when running the command manually just in a shell I still get read-only errors.

Best,  
Jordan

---

<div class="post-metadata">

### Author: ![smf](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@smf](https://discourse.nixos.org/u/smf)
#### Post date: [August 9, 2022, 6:43pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/6 "2022-08-09T18:43:00Z")

</div>

Hey @jordangarrison -

So the wrapHelm line would replace `kubernetes-helm-wrapped` in your buildInputs section:

```auto
let pkgs = import <nixpkgs> { };
in
pkgs.mkShell rec {
  name = "kube-state-metrics-deployment";

  buildInputs = with pkgs; [
    # External Dependencies
    curl
    docker
    git
    kubectl
    (pkgs.wrapHelm pkgs.kubernetes-helm { plugins = [pkgs.kubernetes-helmPlugins.helm-secrets]; })
    kustomize
    jq
    openssh
  ];
}

```

This works on my local, so I’d expect it to be ok on your system, but give me a shout if it doesn’t.

Hope that helps!  
Alex

---

<div class="post-metadata">

### Author: ![jordangarrison](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jordangarrison/32/6366_2.png) [@jordangarrison](https://discourse.nixos.org/u/jordangarrison)
#### Post date: [August 9, 2022, 9:36pm UTC](https://discourse.nixos.org/t/helm-plugin-install/20705/7 "2022-08-09T21:36:11Z")

</div>

This is great! I was missing the `()` syntax. Thanks a ton for your help Alex (@smf)!
