-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
83 lines (71 loc) · 1.98 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
};
outputs = { self, nixpkgs }: {
apps.x86_64-linux.default = {
type = "app";
program = "${self.packages.x86_64-linux.ud3tn}/bin/ud3tn";
};
packages.x86_64-linux =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
{
ud3tn = pkgs.stdenv.mkDerivation {
pname = "ud3tn";
version = "0.13.0";
src = pkgs.lib.sourceByRegex ./. [
"Makefile"
"^components.*"
"^external.*"
"^generated.*"
"^include.*"
"^mk.*"
];
buildPhase = ''
make type=release optimize=yes -j $NIX_BUILD_CORES ud3tn
'';
installPhase = ''
mkdir -p $out/bin
cp build/posix/ud3tn $out/bin/
'';
};
pyd3tn = with pkgs.python3Packages; buildPythonPackage {
name = "pyd3tn";
src = ./pyd3tn;
propagatedBuildInputs = [ cbor ];
};
python-ud3tn-utils = with pkgs.python3Packages; buildPythonPackage {
name = "ud3tn-utils";
src = ./python-ud3tn-utils;
propagatedBuildInputs = [ protobuf setuptools ];
};
};
devShells.x86_64-linux.default =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
pkgs.mkShell {
hardeningDisable = [ "all" ];
packages = with self.packages.x86_64-linux; with pkgs; [
# self
pyd3tn
python-ud3tn-utils
ud3tn
# nixpkgs
clang-tools
gdb
llvmPackages.libcxxClang
nixpkgs-fmt
protobuf
python3Packages.flake8
python3Packages.pip
python3Packages.protobuf
python3Packages.pytest
python3Packages.setuptools
];
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
};
}