mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
813310c343
Adds overlay flake output to expose the bcachefs package and add and run a nix formatter. Co-authored-by: Leona Maroni <dev@leona.is> Signed-off-by: Leona Maroni <dev@leona.is> Signed-off-by: Finn Behrens <me@kloenk.de>
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ lib, stdenv, pkg-config, attr, libuuid, libsodium, keyutils, liburcu, zlib
|
|
, libaio, udev, zstd, lz4, nix-gitignore, rustPlatform, rustc, cargo, }:
|
|
let
|
|
src = nix-gitignore.gitignoreSource [ ] ./.;
|
|
|
|
commit = lib.strings.substring 0 7 (builtins.readFile ./.bcachefs_revision);
|
|
version = "git-${commit}";
|
|
in stdenv.mkDerivation {
|
|
inherit src version;
|
|
|
|
pname = "bcachefs-tools";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
cargo
|
|
rustc
|
|
rustPlatform.cargoSetupHook
|
|
rustPlatform.bindgenHook
|
|
];
|
|
|
|
buildInputs = [
|
|
libaio
|
|
keyutils # libkeyutils
|
|
lz4 # liblz4
|
|
|
|
libsodium
|
|
liburcu
|
|
libuuid
|
|
zstd # libzstd
|
|
zlib # zlib1g
|
|
attr
|
|
udev
|
|
];
|
|
|
|
cargoRoot = "rust-src";
|
|
# when git-based crates are updated, run:
|
|
# nix run github:Mic92/nix-update -- --version=skip --flake default
|
|
# to update the hashes
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
lockFile = "${src}/rust-src/Cargo.lock";
|
|
outputHashes = {
|
|
"bindgen-0.64.0" = "sha256-GNG8as33HLRYJGYe0nw6qBzq86aHiGonyynEM7gaEE4=";
|
|
};
|
|
};
|
|
|
|
makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" "VERSION=${commit}" ];
|
|
|
|
dontStrip = true;
|
|
checkPhase = "./bcachefs version";
|
|
doCheck = true;
|
|
|
|
meta = {
|
|
mainProgram = "bcachefs";
|
|
license = lib.licenses.gpl2Only;
|
|
};
|
|
}
|