Files
libchat/flake.nix

72 lines
2.3 KiB
Nix
Raw Permalink Normal View History

2026-04-17 16:27:15 +03:00
{
description = "libchat - Logos Chat cryptographic library";
nixConfig = {
extra-substituters = [ "https://cache.nix.logos.co/public" ];
extra-trusted-public-keys = [ "public:l4HrXgL4nw246+LBh2SOJyhz64BoGegOYLheT/iIAPU=" ];
};
2026-04-17 16:27:15 +03:00
inputs = {
2026-05-28 23:51:15 +02:00
# nixos-unstable-small has both crates.io UA fixes (NixOS/nixpkgs#512735,
# NixOS/nixpkgs#524985); nixos-unstable hasn't caught up yet as of 2026-05-28.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
2026-04-17 16:27:15 +03:00
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
2026-05-28 23:51:15 +02:00
logos-delivery = {
url = "github:logos-messaging/logos-delivery";
inputs.nixpkgs.follows = "nixpkgs";
};
2026-04-17 16:27:15 +03:00
};
outputs = { self, nixpkgs, rust-overlay, logos-delivery }:
2026-04-17 16:27:15 +03:00
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
2026-04-17 16:27:15 +03:00
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
});
in
{
packages = forAllSystems ({ system, ... }:
{
logos-delivery = logos-delivery.packages.${system}.liblogosdelivery.override {
enablePostgres = false;
enableNimDebugDlOpen = false;
chroniclesLogLevel = "FATAL";
};
2026-04-17 16:27:15 +03:00
}
);
2026-06-26 10:05:28 -07:00
devShells = forAllSystems ({ pkgs, system, ... }:
2026-04-17 16:27:15 +03:00
let
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust_toolchain.toml;
2026-06-26 10:05:28 -07:00
logosDeliveryLib = self.packages.${system}.logos-delivery;
2026-04-17 16:27:15 +03:00
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
pkgs.pkg-config
pkgs.cmake
2026-05-28 23:51:15 +02:00
pkgs.perl
2026-06-15 13:15:18 -07:00
pkgs.protobuf
2026-06-26 10:05:28 -07:00
]
# components/build.rs rewrites the dylib soname via patchelf on
# Linux so consumers link without their own build.rs. macOS uses
# install_name_tool, which ships with the toolchain.
++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.patchelf ];
buildInputs = [ logosDeliveryLib ];
shellHook = ''
export LOGOS_DELIVERY_LIB_DIR="${logosDeliveryLib}/lib"
'';
2026-04-17 16:27:15 +03:00
};
}
);
};
}