photoncloud-monorepo/chainfire/flake.nix
centra 8f94aee1fa Fix R8: Convert submodule gitlinks to regular directories
- Remove gitlinks (160000 mode) for chainfire, flaredb, iam
- Add workspace contents as regular tracked files
- Update flake.nix to use simple paths instead of builtins.fetchGit

This resolves the nix build failure where submodule directories
appeared empty in the nix store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:51:20 +09:00

79 lines
2 KiB
Nix

{
description = "Chainfire - Distributed Key-Value Store with Raft and Gossip";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
};
nativeBuildInputs = with pkgs; [
rustToolchain
pkg-config
protobuf
cmake
];
buildInputs = with pkgs; [
# For RocksDB bindgen
llvmPackages.libclang
llvmPackages.clang
# RocksDB build dependencies (let cargo build rocksdb from source)
snappy
lz4
zstd
zlib
bzip2
# OpenSSL for potential TLS support
openssl
];
# Environment variables for build
shellHook = ''
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"
export PROTOC="${pkgs.protobuf}/bin/protoc"
'';
in
{
devShells.default = pkgs.mkShell {
inherit nativeBuildInputs buildInputs shellHook;
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
PROTOC = "${pkgs.protobuf}/bin/protoc";
};
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "chainfire";
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
inherit nativeBuildInputs buildInputs;
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
PROTOC = "${pkgs.protobuf}/bin/protoc";
# Skip tests during nix build (run separately)
doCheck = false;
};
}
);
}