52 lines
1.5 KiB
Nix
52 lines
1.5 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
let
|
|
productVersion = "0.4.1";
|
|
productName = "blockstream-electrs";
|
|
in
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
with nixpkgs.legacyPackages.${system}; {
|
|
packages =
|
|
{
|
|
default =
|
|
rustPlatform.buildRustPackage {
|
|
name = "${productName}";
|
|
version = "${productVersion}";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
cargoSha256 = "sha256-d84QNj9SIRUwtlsa9sdYKuYf0oCptdGm7pDs3eGTcBg=";
|
|
|
|
preConfigure = ''
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
|
|
'';
|
|
nativeBuildInputs = [ cargo clang cmake ];
|
|
};
|
|
};
|
|
|
|
devShells.default = mkShell {
|
|
inputsFrom = builtins.attrValues self.packages.${system};
|
|
|
|
shellHook = ''
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
|
|
'';
|
|
# LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
|
|
|
|
# I'm never quite sure which one to use, but in this case neither
|
|
# result in a proper dev shell
|
|
buildInputs = [ cargo ];
|
|
nativeBuildInputs = [ cargo clang ];
|
|
};
|
|
|
|
nixosModules = {
|
|
# add moduleA from flakeA as an output
|
|
# moduleA = flakeA.nixosModules.moduleA;
|
|
default = import ./module.nix;
|
|
};
|
|
});
|
|
} |