blob: 6744be6dc894be85161427bb8ba145120c990812 (
plain)
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
|
{ pkgs, lib, config, inputs, ... }:
{
env = {
CXXFLAGS = "-std=c++20";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; # Critical pour trouver OpenSSL
};
packages = with pkgs; [
git
gcc
cmake
clang-tools
openssl.dev # Inclure les headers de développement
zlib.dev
libopus
libsodium
pkg-config
zeromq
cppzmq
ninja
(stdenv.mkDerivation {
name = "dpp";
version = "latest";
src = fetchFromGitHub {
owner = "brainboxdotcc";
repo = "DPP";
rev = "c6bcab5b4632fe35e32e63e3bc813e9e2cd2893e";
sha256 = "sha256-IMESnvvjATgsKCDfrRY8bPxUYpiULIPFf6SToO7GbVM=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ openssl zlib libopus ];
cmakeFlags = [
"-DCMAKE_CXX_STANDARD=20"
"-DBUILD_TEST=OFF"
"-DBUILD_EXAMPLES=OFF"
];
}) # Nécessaire pour détecter OpenSSL
];
languages.go.enable = true;
scripts.build.exec = ''
mkdir -p bot/build
cd bot/build
cmake ..
make -j$NIX_BUILD_CORES
'';
scripts.start.exec = ''
build
mv bot/build/discord-bot ./app
cd app
go run cmd/main.go
'';
# Supprimer la configuration brew inutile dans Nix
}
|