logviewer/flake.nix
2026-02-24 17:20:50 +01:00

77 lines
1.8 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
# for building rust packages
naersk.url = "github:nix-community/naersk";
# for eary pre-built toolchains
nixpkgs-mozilla = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
nixpkgs-mozilla,
naersk,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = (import nixpkgs) {
inherit system;
overlays = [
(import nixpkgs-mozilla)
];
};
toolchain = (
(pkgs.rustChannelOf {
rustToolchain = ./rust-toolchain.toml;
sha256 = "sha256-sqSWJDUxc+zaz1nBWMAJKTAGBuGWP25GCftIOlCEAtA=";
}).rust.override
{
extensions = [
"rust-src"
];
}
);
in
{
packages = {
backend = pkgs.callPackage ./packages/rawr-backend.nix {
inherit naersk toolchain;
};
};
devShells.default =
with pkgs;
mkShell {
nativeBuildInputs = [
openssl
];
buildInputs = [
pkg-config
clang
llvmPackages_latest.bintools
toolchain
];
packages = [
gdb
];
shellHook = ''
export LIBCLANG_PATH="${lib.makeLibraryPath [ llvmPackages_latest.libclang.lib ]}"
export LD_LIBRARY_PATH="'$LD_LIBRARY_PATH:${
lib.makeLibraryPath [
openssl
]
}"
PKG_CONFIG_PATH="${openssl.dev}/lib/pkgconfig";
'';
};
}
);
}