Stream: nix

Topic: Non-Rust dependencies in Rust flake template


view this post on Zulip xqtc (Jan 26 2024 at 17:19):

Hey just stumbled about your template for rust projects. i was wondering where i would pass non rust dependencies when i want to run nix build? my project needs openssl and pkg-config.

view this post on Zulip Srid (Jan 26 2024 at 17:22):

buildInputs

examples

view this post on Zulip xqtc (Jan 26 2024 at 17:30):

Already tried that. Build still fails, saying it can't find pkgconfig. Here's how i defined it:

          # Rust package
          packages.default = pkgs.rustPlatform.buildRustPackage {
            inherit (cargoToml.package) name version;
            buildInputs = [
              pkgs.pkg-config
              pkgs.openssl
            ];
            src = ./.;
            cargoLock.lockFile = ./Cargo.lock;
          };

view this post on Zulip Shivaraj B H (Jan 27 2024 at 02:48):

I believe you are looking for nativeBuildInputs


Last updated: Nov 15 2024 at 12:33 UTC