-
I've been recently building a project that I have a few local crates for that I did not publish and don't intend to. packages = {
editor = craneLib.buildPackage {
src = ./editor;
name = "editor";
version = "1.1.1";
nativeBuildInputs = with pkgs; [
openssl
pkg-config
libiconv
];
buildInputs = with pkgs; [
openssl
pkg-config
libiconv
ffmpeg
];
postInstall = ''
install -Dt $out/bin editor
mkdir $out/bin/.wrapped
mv $out/bin/editor $out/bin/.wrapped/
makeWrapper "$out/bin/.wrapped/editor "$out/bin/editor \
--prefix LD_LIBRARY_PATH : ${pkgs.ffmpeg} \
--prefix PATH : $out/bin
'';
};
};
The program I want to compile depends on like 2 more local crates, is there a way to compile the project so it gets included into the derivation? The issues I saw about this didn't really help me |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I managed to use workspaces with cargo-hakari and now it seems to compile just fine. |
Beta Was this translation helpful? Give feedback.
-
When using The crane/examples/quick-start-workspace/flake.nix Lines 74 to 80 in 9791c77 |
Beta Was this translation helpful? Give feedback.
When using
src = ./editor;
this instructs Nix to only make the./editor
directory available for the derivation. Assuming other workspace crates are in different directories, you will need to change thesrc
attribute to include them.The
quick-start-workspace
example shows how this can be achieved withlib.fileset
:crane/examples/quick-start-workspace/flake.nix
Lines 74 to 80 in 9791c77