Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
96 lines (92 loc) · 3.78 KB
/
Copy pathflake.nix
File metadata and controls
96 lines (92 loc) · 3.78 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
{
description = "Status Go Flake";
nixConfig = {
extra-substituters = [
"https://nix-cache.status.im/"
"https://cache.nix.logos.co/public"
];
extra-trusted-public-keys = [
"nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY="
"public:zaDAOkd+E3cQyFm9J7qejQYd9HoLJc1SJvnk68hNWeI="
];
# Some downloads are multiple GB, default is 5 minutes
stalled-download-timeout = 3600;
connect-timeout = 10;
max-jobs = "auto";
# Some builds on MacOS have issue with sandbox so they are disabled with __noChroot.
sandbox = "relaxed";
};
inputs = {
nim-token-lists = {
url = "git+https://github.com/status-im/nim-token-lists?submodules=1&rev=4df3308a32b0f3da18ef0d37d26fa9f1195f8b9e";
flake = false;
};
# We are pinning the commit because ultimately we want to use same commit across different projects.
# A commit from nixpkgs 25.11 release : https://github.com/NixOS/nixpkgs/tree/release-25.11
nixpkgs.url = "github:NixOS/nixpkgs/535f3e6942cb1cead3929c604320d3db54b542b9";
logos-storage-nim = {
# TODO: temporary pin, see https://github.com/logos-storage/logos-storage-nim/pull/1496
url = "git+https://github.com/logos-storage/logos-storage-nim?submodules=1&rev=978c560aed6dc4cff6b602e94fc0fcc66fea6399";
inputs.nixpkgs.follows = "nixpkgs";
};
# We cannot do follows since the nim-unwrapped-2_0 doesn't exist in this nixpkgs version above
nim-sds.url = "git+https://github.com/logos-messaging/nim-sds?submodules=1&rev=8f7fee08f0256c1788089e756182c8be0a621930";
# nimble 0.20.1 in the nixpkgs above cannot resolve nim-sds through the bindings.
nixpkgs-nimble.url = "github:NixOS/nixpkgs/34ab99075ac4f7e40cf037eef32cb1c360bb85e9";
};
outputs = { self, nixpkgs, logos-storage-nim, nim-sds, nim-token-lists, nixpkgs-nimble }:
let
stableSystems = [
"x86_64-linux" "aarch64-linux"
"x86_64-darwin" "aarch64-darwin"
"x86_64-windows"
];
forAllSystems = f: nixpkgs.lib.genAttrs stableSystems (system: f system);
pkgsOverlay = import ./nix/overlay.nix;
# nim-sds/logos-storage-nim hardcode XDG_CACHE_HOME=/tmp, which causes
# nim cache collisions at /tmp/nim/<name>_d/ on macOS
useTmpdirForNimCache = drv: drv.overrideAttrs (old: {
preBuild = ''export XDG_CACHE_HOME="$TMPDIR"'' + "\n" + (old.preBuild or "");
});
pkgsFor = forAllSystems (
system: import nixpkgs {
inherit system;
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
overlays = [
pkgsOverlay
(final: prev: {
libtkl = final.callPackage ./nix/pkgs/libtkl { src = nim-token-lists; };
libsds = useTmpdirForNimCache nim-sds.packages.${system}.libsds;
libstorage = useTmpdirForNimCache logos-storage-nim.packages.${system}.libstorage;
nimble = nixpkgs-nimble.legacyPackages.${system}.nimble.overrideAttrs (_: {
version = "0.26.1";
src = final.fetchFromGitHub {
owner = "nim-lang";
repo = "nimble";
tag = "v0.26.1";
hash = "sha256-tTlUZBJY380sV6c6ijYtjDafdgPhI8pda1392WgI9e0=";
fetchSubmodules = true;
};
});
})
];
}
);
in {
devShells = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./nix/shell.nix { };
});
packages = forAllSystems (system: let
pkgs = pkgsFor.${system};
statusGo = import ./nix/pkgs/status-go { inherit self pkgs; };
in {
status-go-library = statusGo.library;
libtkl = pkgs.libtkl;
status-go-mobile-android = statusGo.mobile.android {};
status-go-mobile-ios = statusGo.mobile.ios {};
});
};
}