-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathflake.nix
More file actions
119 lines (117 loc) · 3.73 KB
/
Copy pathflake.nix
File metadata and controls
119 lines (117 loc) · 3.73 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Flake Shell for building release artifacts for swift and kotlin
{
nixConfig = {
http-connections = 128;
max-substitution-jobs = 128;
sandbox = "relaxed";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
};
foundry.url = "github:shazow/foundry.nix/stable";
crane = {
url = "github:ipetkov/crane";
};
rust-manifest = {
url = "https://static.rust-lang.org/dist/channel-rust-1.97.1.toml";
flake = false;
};
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"x86_64-linux"
"aarch64-linux"
];
imports = [
./nix/lib
flake-parts.flakeModules.easyOverlay
inputs.treefmt-nix.flakeModule
./nix/musl-docker.nix
./nix/ci-checks.nix
./nix/fmt.nix
./nix/node-packages.nix
./nix/android-packages.nix
./nix/apps.nix
];
perSystem =
{
pkgs,
lib,
self',
system,
...
}:
{
_module.args.pkgs = lib.mkForce (self.lib.mkXmtpPkgs { inherit system; });
overlayAttrs = {
inherit (self'.packages) xnet-cli;
};
devShells = {
rust = pkgs.callPackage ./nix/shells/rust.nix { };
default = pkgs.callPackage ./nix/shells/local.nix { };
android = pkgs.callPackage ./nix/shells/android.nix { };
js = pkgs.callPackage ./nix/js.nix { };
wasm = (pkgs.callPackage ./nix/package/wasm.nix { }).devShell;
}
// lib.optionalAttrs pkgs.stdenv.isDarwin {
ios = pkgs.callPackage ./nix/shells/ios.nix { };
};
packages = {
inherit (pkgs.xmtp)
ffi-uniffi-bindgen
xdbg-driver-lib
cross-talk-test
cross-version-test
;
inherit (pkgs)
napi-rs-cli
wasm-bindgen-cli
;
wasm-bindings = (pkgs.callPackage ./nix/package/wasm.nix { }).bin;
wasm-bindings-test = (pkgs.callPackage ./nix/package/wasm.nix { test = true; }).bin;
}
// lib.optionalAttrs pkgs.stdenv.isDarwin {
# stdenvNoCC is passed to callPackage (for the aggregate derivation).
# This avoids Nix's apple-sdk and cc-wrapper,
# which inject -mmacos-version-min flags that
# conflict with iOS cross-compilation. The builds are impure (__noChroot)
# and use the system Xcode SDK directly via ios-env.nix paths.
ios-libs =
(pkgs.callPackage ./nix/package/ios.nix {
stdenv = pkgs.stdenvNoCC;
}).aggregate;
# iOS bindings - simulator + host macOS only (fast dev/CI builds)
ios-libs-fast =
(
(pkgs.callPackage ./nix/package/ios.nix {
stdenv = pkgs.stdenvNoCC;
}).mkIos
[
"aarch64-apple-darwin"
"aarch64-apple-ios-sim"
]
).aggregate;
ios-xcframeworks =
(pkgs.callPackage ./nix/package/ios.nix {
stdenv = pkgs.stdenvNoCC;
}).release;
ios-xcframeworks-fast =
(pkgs.callPackage ./nix/package/ios.nix {
stdenv = pkgs.stdenvNoCC;
}).devFast;
};
};
};
}