Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
# Flake inputs
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2505.*.tar.gz";
go-flake.url = "path:./nix/go";
go-flake.inputs.nixpkgs.follows = "nixpkgs";
};

# Flake outputs
outputs = { self, nixpkgs }:
outputs = { self, nixpkgs, go-flake }:
let
# Systems supported
allSystems = [
Expand All @@ -39,8 +41,8 @@
# Task runner
go-task

# Local Go package
(import ./nix/go.nix { inherit pkgs; })
# Local Go package from nested flake
go-flake.packages.${pkgs.system}.default

# Monitoring tools
promtail # Loki log shipper
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module github.com/ava-labs/avalanchego
// - CONTRIBUTING.md
// - README.md
// - go.mod (here)
// - nix/go.nix (update version and sha256 for supported arches)
// - nix/go/default.nix (update version and sha256 for supported arches)
// - tools/go.mod
//
// - If updating between minor versions (e.g. 1.24.x -> 1.25.x):
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions nix/go/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions nix/go/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
# To use locally: nix run ./nix/go
# To use remotely: nix run 'github:ava-labs/avalanchego?dir=nix/go'
# To use remotely at a specific revision: nix run 'github:ava-labs/avalanchego?dir=nix/go&ref=[SHA]'

description = "Go toolchain for Avalanche projects";

# Flake inputs
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2505.*.tar.gz";
};

# 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
{
# Export the Go package for other flakes to consume
packages = forAllSystems ({ pkgs }: {
default = import ./. { inherit pkgs; };
});
};
}