Adding additional files to bash script package

I have a bash script that sends notifications with some icons. I’ve created a package for the script with writeShellScriptBin but how do I add icons to it?

Sorry if this is common knowledge. I’m a noob and didn’t find any information on this

Forgot to post the solution.

It turned out to be super easy. You just include the nix path to the files you need in the script with ${./path} and they automatically get copied over to the nix store:

{ pkgs }:

pkgs.writeShellScriptBin "get-icon" ''
  echo "Icon: ${./icon.png}"
''
1 Like