nix-community / gomod2nix

Convert applications using Go modules to Nix expressions [maintainer=@marcusramberg]
MIT License
233 stars 56 forks source link

Pass down runtime dependencies #157

Closed brumik closed 5 months ago

brumik commented 6 months ago

I would like to pass down to the compiled application a runtime dependency just like in

writeShellApplication {
  runtimeInputs = [ pkgs.bitwarden-cli ];
  ...
}

I tried to pass down buildInputs with no avail. Could somebody help me out what to look for? I do not see this option in mkDerivation nor within this library.

Context: My go application needs a cli too to execute under the hood. It works just fine if I already have the tool installed (like in the shell.nix) but once I use it as a package it cannot use the cli tool anymore. https://github.com/brumik/bw-setup-secrets/

brumik commented 5 months ago

I did it with post fixup and wrapper:

  postFixup = ''
    wrapProgram "$out/bin/bw-setup-secrets" --set PATH ${lib.makeBinPath [
      pkgs.bitwarden-cli
    ]}
  '';