-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (67 loc) · 2.32 KB
/
Copy pathflake.nix
File metadata and controls
71 lines (67 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "libchat - Logos Chat cryptographic library";
nixConfig = {
extra-substituters = [ "https://cache.nix.logos.co/public" ];
extra-trusted-public-keys = [ "public:l4HrXgL4nw246+LBh2SOJyhz64BoGegOYLheT/iIAPU=" ];
};
inputs = {
# 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";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
logos-delivery = {
url = "github:logos-messaging/logos-delivery";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, rust-overlay, logos-delivery }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system;
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";
};
}
);
devShells = forAllSystems ({ pkgs, system, ... }:
let
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust_toolchain.toml;
logosDeliveryLib = self.packages.${system}.logos-delivery;
in
{
default = pkgs.mkShell {
nativeBuildInputs = [
rustToolchain
pkgs.pkg-config
pkgs.cmake
pkgs.perl
pkgs.protobuf
]
# 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"
'';
};
}
);
};
}