-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
78 lines (70 loc) · 1.82 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
{
description = "Tools needed for puls development.";
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-unstable";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs =
{ self
, nixpkgs
, flake-compat
, flake-utils
,
} @ inputs:
flake-utils.lib.eachSystem
[
flake-utils.lib.system.x86_64-linux
flake-utils.lib.system.x86_64-darwin
flake-utils.lib.system.aarch64-linux
flake-utils.lib.system.aarch64-darwin
]
(
system:
let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
system = system;
config.allowBroken = true;
};
apache-pulsar = pkgs.callPackage ./nix/apache-pulsar.nix { };
missingSysPkgs =
if pkgs.stdenv.isDarwin then
[
pkgs.darwin.apple_sdk.frameworks.Foundation
pkgs.darwin.libiconv
]
else
[ ];
runtimeLibraryPath = lib.makeLibraryPath ([ pkgs.zlib ]);
puls-dev = pkgs.mkShell {
shellHook = ''
export JAVA_HOME=$(echo "$(which java)" | sed 's/\/bin\/java//g' )
export LD_LIBRARY_PATH="${runtimeLibraryPath}"
'';
packages = [
pkgs.gnumake
pkgs.coreutils
pkgs.git
pkgs.rustup
pkgs.rustfmt
pkgs.cargo-cross
apache-pulsar
] ++ missingSysPkgs;
};
in
rec {
packages = { };
packages.default = puls-dev;
devShells.default = puls-dev;
devShell = devShells.default;
}
);
}