-
I set up a How do I work with Thanks! flake.nix: {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
system = system;
overlays = [ (import rust-overlay) ];
};
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile
./rust-toolchain.toml;
lib = crane.lib.${system}.overrideToolchain rustToolchain;
rss-email = lib.buildPackage {
VERSION = "test";
src = ./.;
nativeBuildInputs = with pkgs; [ ];
installCargoArtifactsMode = "use-symlink";
installPhase = ''
mkdir -p $out
make install PREFIX=$out
'';
};
in
{
packages.default = rss-email;
}
);
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
By default, if you don't take care of splitting your build into deps-only + normal (using https://github.com/ipetkov/crane/blob/master/docs/API.md#optional-attributes-1 |
Beta Was this translation helpful? Give feedback.
By default, if you don't take care of splitting your build into deps-only + normal (using
cargoArtifacts
), the crane lib will do it for you and both of these will run yourinstallPhase
. Usually such default behavior OK, but here it will not work, as in deps-only build, almost all files/code is missing andmake
needs them.https://github.com/ipetkov/crane/blob/master/docs/API.md#optional-attributes-1