blockstream-electrs/flake.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

2023-08-12 03:50:50 +00:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
productVersion = "0.4.1";
2023-08-12 04:14:52 +00:00
productName = "blockstream-electrs";
2023-08-12 03:50:50 +00:00
in
flake-utils.lib.eachDefaultSystem (system:
with nixpkgs.legacyPackages.${system}; {
2023-08-12 12:34:39 +00:00
packages =
{
default =
rustPlatform.buildRustPackage {
name = "${productName}";
version = "${productVersion}";
2023-08-12 03:50:50 +00:00
2023-08-12 12:34:39 +00:00
src = lib.cleanSource ./.;
2023-08-12 03:50:50 +00:00
2023-08-12 12:34:39 +00:00
cargoSha256 = "sha256-d84QNj9SIRUwtlsa9sdYKuYf0oCptdGm7pDs3eGTcBg=";
2023-08-12 03:50:50 +00:00
2023-08-12 12:34:39 +00:00
preConfigure = ''
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
'';
nativeBuildInputs = [ cargo clang cmake ];
};
2023-08-12 03:50:50 +00:00
};
2023-08-12 12:34:39 +00:00
devShells.default = mkShell {
2023-08-12 03:50:50 +00:00
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 ];
};
2023-08-12 12:40:32 +00:00
nixosModules = {
# add moduleA from flakeA as an output
# moduleA = flakeA.nixosModules.moduleA;
2023-08-12 15:43:37 +00:00
default = import ./module.nix;
2023-08-12 12:40:32 +00:00
};
2023-08-12 03:50:50 +00:00
});
}