From 46a8c9fdebe64a60f793ba08562c23fcf5e2102d Mon Sep 17 00:00:00 2001 From: Thomas Churchman Date: Mon, 18 Mar 2024 17:05:30 +0100 Subject: [PATCH] nix: add mqtt-ingest package to build --- nix/build.nix | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/nix/build.nix b/nix/build.nix index 3d678ab..b83f849 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -1,21 +1,46 @@ -{ rustPlatform +{ pkgs +, rustPlatform , pkg-config , capnproto , openssl , postgresql , ... }: -rustPlatform.buildRustPackage rec { - pname = "astroplant-api"; - version = "1.0.0.alpha-1"; +let + astroplant-api = rustPlatform.buildRustPackage rec { + pname = "astroplant-api"; + version = "1.0.0.alpha-1"; - src = ../.; - cargoLock = { lockFile = ../Cargo.lock; }; + src = ../.; + cargoLock = { lockFile = ../Cargo.lock; }; - depsBuildBuild = [ capnproto ]; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - openssl - postgresql + depsBuildBuild = [ capnproto ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + openssl + postgresql + ]; + }; + astroplant-mqtt-ingest = rustPlatform.buildRustPackage rec { + pname = "astroplant-mqtt-ingest"; + version = "1.0.0.alpha-1"; + + src = ../.; + buildAndTestSubdir = "astroplant-mqtt-ingest"; + cargoLock = { lockFile = ../Cargo.lock; }; + + depsBuildBuild = [ capnproto ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + openssl + postgresql + ]; + }; +in +pkgs.buildEnv { + name = "astroplant"; + paths = [ + astroplant-api + astroplant-mqtt-ingest ]; }