forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
90 lines (74 loc) · 2.49 KB
/
flake.nix
File metadata and controls
90 lines (74 loc) · 2.49 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
{
# To use:
# - install nix: `./scripts/run_task.sh install-nix`
# - run `nix develop` or use direnv (https://direnv.net/)
# - for quieter direnv output, set `export DIRENV_LOG_FORMAT=`
description = "AvalancheGo development environment";
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
};
# Flake outputs
outputs = { self, nixpkgs }:
let
# Systems supported
allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS
];
# Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
# Development environment output
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = with pkgs; [
# Build requirements
git
# Task runner
go-task
# Local Go package
(import ./nix/go { inherit pkgs; })
# Monitoring tools
promtail # Loki log shipper
prometheus # Metrics collector
# Kube tools
kubectl # Kubernetes CLI
k9s # Kubernetes TUI
kind # Kubernetes-in-Docker
kubernetes-helm # Helm CLI (Kubernetes package manager)
# JSON processing
jq
# Linters
shellcheck
# Protobuf
buf
protoc-gen-go
protoc-gen-go-grpc
protoc-gen-connect-go
# Line-oriented search tool
ripgrep
# Solidity compiler
solc
# s5cmd for rapid s3 interactions
s5cmd
];
# Add scripts/ directory to PATH so kind-with-registry.sh is accessible
shellHook = ''
export PATH="$PWD/scripts:$PATH"
# Ensure golang bin is in the path
GOBIN="$(go env GOPATH)/bin"
if [[ ":$PATH:" != *":$GOBIN:"* ]]; then
export PATH="$GOBIN:$PATH"
fi
'';
};
});
};
}