crane-reproducer-workspace-.../flake.nix
Marcel Müller 625b53d05e Initial commit
Signed-off-by: Marcel Müller <neikos@neikos.email>
2026-03-20 10:33:01 +01:00

47 lines
896 B
Nix

{
description = "Reproduce crane include wrong Cargo.toml";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=25.11";
crane.url = "github:ipetkov/crane";
};
outputs =
{
self,
nixpkgs,
crane,
}:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
craneLib = crane.mkLib pkgs;
fileset = pkgs.lib.fileset;
src = fileset.toSource {
root = ./.;
fileset = fileset.unions [
./Cargo.toml
./member
./not-a-member
];
};
commonArgs = {
inherit src;
sourceRoot = "source/not-a-member";
strictDeps = true;
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
testPackage = craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; });
in
{
packages.x86_64-linux.default = testPackage;
};
}