forked from input-output-hk/partner-chains
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
116 lines (105 loc) · 3.11 KB
/
flake.nix
File metadata and controls
116 lines (105 loc) · 3.11 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
{
description = "Your devShell environment using flake-utils";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
cardano-node = {
url = "github:IntersectMBO/cardano-node/10.1.4";
flake = false;
};
flake-compat = {
url = "github:input-output-hk/flake-compat/fixes";
flake = false;
};
};
outputs =
{
nixpkgs,
fenix,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "Qxt8XAuaUR2OMdKbN4u8dBJOhSHxS+uS06Wl9+flVEk=";
};
isLinux = pkgs.stdenv.isLinux;
isDarwin = pkgs.stdenv.isDarwin;
in
{
devShells.default = pkgs.mkShell {
packages =
with pkgs;
[
awscli2
bashInteractive
cargo-edit
cargo-license
coreutils
docker-compose
earthly
gawk
gnumake
kubectl
libiconv
nixfmt-rfc-style
openssl
patchelf
pkg-config
protobuf
python312
python312Packages.pip
python312Packages.virtualenv
rustToolchain
sops
xxd
]
++ (if isDarwin then [ pkgs.darwin.apple_sdk.frameworks.SystemConfiguration ] else [ pkgs.clang ]);
shellHook = ''
export RUST_SRC_PATH="${rustToolchain}/lib/rustlib/src/rust/library"
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
export LD_LIBRARY_PATH="${
pkgs.lib.makeLibraryPath [
rustToolchain
pkgs.libz
pkgs.stdenv.cc.cc
]
}"
export OPENSSL_NO_VENDOR=1
export OPENSSL_DIR="${pkgs.openssl.dev}"
export OPENSSL_INCLUDE_DIR="${pkgs.openssl.dev}/include"
export OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib"
export PYTHONNOUSERSITE=1
export CRATE_CC_NO_DEFAULTS=1
${if isLinux then "export CFLAGS=-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else ""}
'';
};
formatter = pkgs.nixfmt-rfc-style;
}
);
nixConfig = {
allow-import-from-derivation = true;
accept-flake-config = true;
extra-substituters = [
"https://nix-community.cachix.org"
"https://cache.iog.io"
"https://cache.sc.iog.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.sc.iog.io:b4YIcBabCEVKrLQgGW8Fylz4W8IvvfzRc+hy0idqrWU="
];
};
}