tijdelijk-te-laat/rust/flake.nix
2025-07-03 12:37:07 +02:00

46 lines
1.1 KiB
Nix

{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
naersk,
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage {
src = ./.;
# nativeBuildInputs = with pkgs; [
# ];
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath nativeBuildInputs;
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
};
devShell =
with pkgs;
mkShell {
buildInputs = [
cargo
rustc
rustfmt
pre-commit
rustPackages.clippy
openssl
pkg-config
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
RUST_BACKTRACE = 1;
};
}
);
}