forked from mozsearch/mozsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
79 lines (66 loc) · 2.27 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
79
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
flake-utils.url = github:numtide/flake-utils;
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, fenix }: (
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend fenix.overlays.default;
rustToolchain = pkgs.fenix.stable.toolchain;
# A symlink from `docker` to `podman`, because the scripts call `docker`.
dockerCompat = pkgs.runCommandNoCC "docker-podman-compat" {} ''
mkdir -p $out/bin
ln -s ${pkgs.podman}/bin/podman $out/bin/docker
'';
pythonPackages = p: with p; [
boto3
rich
];
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
dockerCompat
podman
# Those are probably not all required, copied from
# https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947
runc # Container runtime
conmon # Container runtime monitor
skopeo # Interact with container registry
slirp4netns # User-mode networking for unprivileged namespaces
fuse-overlayfs # CoW for images, much faster than default vfs
jq
awscli2
(python3.withPackages pythonPackages)
# Dependencies required to build tools
rustToolchain
openssl
cmake
pkg-config
# Dependencies required to build clang-plugin
# Update to llvmPackages_17 when available
clang
llvmPackages_16.libllvm
llvmPackages_16.libclang
scip
protobuf
clang-tools_16
];
PODMAN_USERNS = "keep-id";
AWS_PROFILE = "searchfox";
shellHook = ''
echo "TL;DR:"
echo "- './build-docker.sh' to build the container"
echo "- './run-docker.sh' to enter the container"
echo "- 'cd /vagrant; make build-test-repo' inside to build"
echo "- open http://localhost:16995 in a browser"
'';
};
}
)
);
}