-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
63 lines (56 loc) · 1.59 KB
/
flake.nix
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
};
outputs = {self, ...} @ inputs:
inputs.utils.lib.eachDefaultSystem (system: let
pkgs = inputs.nixpkgs.legacyPackages.${system};
cc = pkgs.gcc12;
python = pkgs.python311;
deriv = name:
pkgs.stdenv.mkDerivation rec {
inherit name;
src = ./.;
buildInputs = with pkgs; [glibc gnumake pkg-config libuuid];
nativeBuildInputs = [pkgs.makeWrapper];
makeFlags = ["CC=${cc}/bin/gcc"];
hardeningDisable = ["format" "fortify"];
enableParallelBuilding = true;
buildPhase = ''
make ${name}
'';
installPhase = ''
mkdir -p $out/bin
cp ${name} $out/bin
'';
postFixup = ''
wrapProgram $out/bin/${name} --set LD_LIBRARY_PATH ${./libs/myteams}
'';
};
in rec {
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
packages =
packages.server.buildInputs
++ (with pkgs; [
criterion
gcovr
valgrind
bear
gdb
])
++ [python]
++ (with python.pkgs; [venvShellHook black]);
LD_LIBRARY_PATH = ["./libs/myteams"];
venvDir = ".venv";
postVenvCreation = ''
pip install -r ${./tests/requirements.txt}
'';
};
packages = {
server = deriv "myteams_server";
client = deriv "myteams_cli";
};
});
}