aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-05-02 20:27:40 +0200
committerLibravatar Rutger Broekhoff2024-05-02 20:27:40 +0200
commit17a3ea880402338420699e03bcb24181e4ff3924 (patch)
treeda666ef91e0b60d20aa0b01529644c136fd1f4ab /flake.nix
downloadoeuf-17a3ea880402338420699e03bcb24181e4ff3924.tar.gz
oeuf-17a3ea880402338420699e03bcb24181e4ff3924.zip
Initial commit
Based on dc4ba6a
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix137
1 files changed, 137 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..df5fffb
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,137 @@
1{
2 inputs = {
3 nixpkgs.url = "https://flakehub.com/f/NixOs/nixpkgs/*.tar.gz";
4 flake-utils.url = "https://flakehub.com/f/numtide/flake-utils/0.1.88.tar.gz";
5 libtmi8 = {
6 url = "path:./lib/libtmi8";
7 inputs.nixpkgs.follows = "nixpkgs";
8 inputs.flake-utils.follows = "flake-utils";
9 };
10 };
11
12 outputs = { self, nixpkgs, flake-utils, libtmi8, ... }@inputs:
13 {
14 nixosModules = rec {
15 oeuf = import ./module self;
16 default = oeuf;
17 };
18 } // flake-utils.lib.eachDefaultSystem
19 (system:
20 let
21 libtmi8Overlay = final: prev: { oeuf-libtmi8 = libtmi8.packages.${system}.oeuf-libtmi8; };
22
23 pkgs = import nixpkgs {
24 inherit system;
25 overlays = [ libtmi8Overlay ];
26 };
27 boostPkg = pkgs.boost182;
28
29 inherit (pkgs.gcc13) stdenv;
30
31 oeuf-augmentkv6 = stdenv.mkDerivation {
32 name = "oeuf-augmentkv6";
33 src = ./.;
34
35 nativeBuildInputs = with pkgs; [ gcc13 boostPkg ];
36 buildInputs = with pkgs; [ arrow-cpp oeuf-libtmi8 ];
37 buildPhase = ''
38 cd src/augmentkv6
39 make augmentkv6
40 '';
41
42 installPhase = ''
43 mkdir -p $out/bin
44 cp augmentkv6 $out/bin/oeuf-augmentkv6
45 '';
46 };
47
48 oeuf-filterkv6 = stdenv.mkDerivation {
49 name = "oeuf-filterkv6";
50 src = ./.;
51
52 nativeBuildInputs = with pkgs; [ gcc13 ];
53 buildInputs = with pkgs; [ arrow-cpp oeuf-libtmi8 ];
54 buildPhase = ''
55 cd src/filterkv6
56 make filterkv6
57 '';
58
59 installPhase = ''
60 mkdir -p $out/bin
61 cp filterkv6 $out/bin/oeuf-filterkv6
62 '';
63 };
64
65 oeuf-bundleparquet = stdenv.mkDerivation {
66 name = "oeuf-bundleparquet";
67 src = ./.;
68
69 nativeBuildInputs = with pkgs; [ gcc13 ];
70 buildInputs = with pkgs; [ arrow-cpp curl nlohmann_json prometheus-cpp zlib oeuf-libtmi8 ];
71 buildPhase = ''
72 cd src/bundleparquet
73 make bundleparquet
74 '';
75
76 installPhase = ''
77 mkdir -p $out/bin
78 cp bundleparquet $out/bin/oeuf-bundleparquet
79 '';
80 };
81
82 oeuf-querykv1 = stdenv.mkDerivation {
83 name = "oeuf-querykv1";
84 src = ./.;
85
86 nativeBuildInputs = with pkgs; [ gcc13 ];
87 buildInputs = with pkgs; [ oeuf-libtmi8 boostPkg ];
88 buildPhase = ''
89 cd src/querykv1
90 make querykv1
91 '';
92
93 installPhase = ''
94 mkdir -p $out/bin
95 cp querykv1 $out/bin/oeuf-querykv1
96 '';
97 };
98
99 oeuf-recvkv6 = stdenv.mkDerivation {
100 name = "oeuf-recvkv6";
101 src = ./.;
102
103 nativeBuildInputs = with pkgs; [ gcc13 ];
104 buildInputs = with pkgs; [ zeromq zlib arrow-cpp nlohmann_json prometheus-cpp rapidxml oeuf-libtmi8 ];
105 buildPhase = ''
106 cd src/recvkv6
107 make recvkv6
108 '';
109
110 installPhase = ''
111 mkdir -p $out/bin
112 cp recvkv6 $out/bin/oeuf-recvkv6
113 '';
114 };
115
116 oeuf-archiver = import ./script/archiver {
117 pkgs = pkgs // { inherit oeuf-bundleparquet; };
118 };
119
120 oeuf-synckv6 = import ./script/synckv6 { inherit pkgs; };
121 in
122 {
123 packages.oeuf-archiver = oeuf-archiver;
124 packages.oeuf-augmentkv6 = oeuf-augmentkv6;
125 packages.oeuf-synckv6 = oeuf-synckv6;
126 packages.oeuf-filterkv6 = oeuf-filterkv6;
127 packages.oeuf-bundleparquet = oeuf-bundleparquet;
128 packages.oeuf-querykv1 = oeuf-querykv1;
129 packages.oeuf-recvkv6 = oeuf-recvkv6;
130
131 devShells.default = pkgs.mkShell {
132 inputsFrom = [ oeuf-bundleparquet oeuf-querykv1 oeuf-recvkv6 ];
133 };
134
135 formatter = pkgs.nixpkgs-fmt;
136 });
137}