From 846c465ea0988f2b5abef44d7443d536102acee1 Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 26 Apr 2025 13:11:54 -0400 Subject: [PATCH] fix flake --- flake.nix | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 5796366..1ee2f5d 100644 --- a/flake.nix +++ b/flake.nix @@ -23,34 +23,40 @@ toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; craneLib = (crane.mkLib pkgs).overrideToolchain(_: toolchain); lib = pkgs.lib; + nativeBuildInputs = with pkgs; [ + pkg-config + ]; + buildInputs = with pkgs; [ + toolchain + openssl + nix + boost + ]; + env = { + # for cpp bindings to work + NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include"; + }; in { devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - pkg-config - ]; - buildInputs = with pkgs; [ - toolchain - openssl - nix - boost + inherit buildInputs; + inherit nativeBuildInputs; + packages = with pkgs; [ tokio-console cargo-udeps ]; - NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include"; - RUST_LOG = "nixcp=debug"; - RUST_BACKGRACE = 1; + env = env // { + RUST_LOG = "nixcp=debug"; + RUST_BACKGRACE = 1; + }; }; packages.default = craneLib.buildPackage { + inherit nativeBuildInputs; + inherit buildInputs; + inherit env; src = craneLib.cleanCargoSource ./.; strictDeps = true; - nativeBuildInputs = with pkgs; [ - pkg-config - ]; - buildInputs = with pkgs; [ - openssl - ]; }; } );