-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
68 lines (64 loc) · 1.81 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
{
description = "sn-bindgen";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.sbt.url = "github:zaninime/sbt-derivation/master";
inputs.sbt.inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.url = "github:nix-systems/default";
outputs =
{ self
, nixpkgs
, sbt
, systems
}:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = eachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
default = sbt.mkSbtDerivation.${system} {
pname = "sn-bindgen";
version = "0.1.0";
src = with pkgs.lib.fileset; toSource {
root = ./.;
fileset = unions [
./build
./docs
./modules
./project
./build.sbt
];
};
depsSha256 = "sha256-guxXAKIlTi48ZFQwFyEV6bHPy0islCfQiOMf9slCsYM=";
buildPhase = ''
sbt 'show buildBinary'
'';
depsWarmupCommand = ''
sbt 'update'
sbt 'iface/compile ; iface2_12/compile ; iface3/compile'
sbt 'ifaceNative/compile ; ifaceNative2_12/compile ; ifaceNative3/compile'
'';
installPhase = ''
mkdir -p $out/bin
cp bin/bindgen $out/bin/
'';
buildInputs = with pkgs; [
llvmPackages_17.libclang
];
nativeBuildInputs = with pkgs; [
clang_17
libunwind
stdenv
which
zlib
];
meta.mainProgram = "bindgen";
};
}
);
overlays.default = final: prev: {
sn-bindgen = self.packages.${final.system}.default;
};
};
}