50 lines
1.5 KiB
Nix
50 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.${productName} = rustPlatform.buildRustPackage {
|
|
name = "${productName}";
|
|
version = "${productVersion}";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
cargoSha256 = "sha256-d84QNj9SIRUwtlsa9sdYKuYf0oCptdGm7pDs3eGTcBg=";
|
|
|
|
preConfigure = ''
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
|
|
'';
|
|
nativeBuildInputs = [ cargo clang cmake ];
|
|
};
|
|
|
|
defaultPackage = self.packages.${system}.${productName};
|
|
|
|
devShell = 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.${productName} = import [ ./module.nix ];
|
|
# nixosModules.default = nixosModules.${productName};
|
|
nixosModules.default = { config, pkgs, lib, ... }: {
|
|
imports = [ ./module.nix ];
|
|
};
|
|
});
|
|
} |