magic-nix-cache/package.nix

55 lines
1 KiB
Nix
Raw Normal View History

{ lib, stdenv, rustPlatform
, pkg-config
, installShellFiles
, nix
, boost
, darwin
2024-02-29 20:42:35 +00:00
, rust-analyzer
, clippy
, rustfmt
}:
let
ignoredPaths = [ ".github" "target" "book" ];
in rustPlatform.buildRustPackage rec {
pname = "magic-nix-cache";
version = "0.1.0";
src = lib.cleanSourceWith {
filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) ignoredPaths);
src = lib.cleanSource ./.;
};
nativeBuildInputs = [
pkg-config
installShellFiles
2024-02-29 20:42:35 +00:00
rust-analyzer
clippy
rustfmt
];
buildInputs = [
nix boost
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
SystemConfiguration
]);
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
ATTIC_DISTRIBUTOR = "attic";
2024-01-09 12:32:12 +00:00
# Hack to fix linking on macOS.
NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin "-lc++abi";
# Recursive Nix is not stable yet
doCheck = false;
2024-01-09 11:02:14 +00:00
postFixup = ''
rm -f $out/nix-support/propagated-build-inputs
'';
}