Skip to content
Draft
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
3 changes: 3 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
buildGoApplication,
go,
nix-gitignore,
coverage ? false, # https://tip.golang.org/doc/go1.20#cover
rocksdb,
Expand Down Expand Up @@ -39,6 +40,7 @@ buildGoApplication rec {
tags
ldflags
;
inherit go;
src = (
nix-gitignore.gitignoreSourcePure [
"/*" # ignore all, then add whitelists
Expand All @@ -55,6 +57,7 @@ buildGoApplication rec {
] ./.
);
modules = ./gomod2nix.toml;
modRoot = ".";
pwd = src; # needed to support replace
subPackages = [ "cmd/cronosd" ];
buildFlags = lib.optionalString coverage "-cover";
Expand Down
10 changes: 5 additions & 5 deletions flake.lock

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

46 changes: 30 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
nixpkgs.url = "github:NixOS/nixpkgs/release-25.11";
flake-utils.url = "github:numtide/flake-utils";
nix-bundle-exe = {
url = "github:3noch/nix-bundle-exe";
Expand Down Expand Up @@ -29,6 +29,19 @@
}:
let
rev = self.shortRev or "dirty";
gomodOverlay =
final: prev:
let
gomodSrc = gomod2nix.outPath;
callPackage = final.callPackage;
in
{
inherit (callPackage "${gomodSrc}/builder" { }) buildGoApplication mkGoEnv mkVendorEnv;
gomod2nix =
(callPackage "${gomodSrc}/default.nix" { }).overrideAttrs (_: {
modRoot = ".";
});
};
mkApp = drv: {
type = "app";
program = "${drv}/bin/${drv.meta.mainProgram}";
Expand Down Expand Up @@ -77,20 +90,21 @@
}
))
// {
overlays.default = [
(import ./nix/build_overlay.nix)
poetry2nix.overlays.default
gomod2nix.overlays.default
(import ./testground/benchmark/overlay.nix)
(final: super: {
go = super.go_1_23;
test-env = final.callPackage ./nix/testenv.nix { };
cronos-matrix = final.callPackage ./nix/cronos-matrix.nix {
inherit rev;
bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { };
};
testground-image = final.callPackage ./nix/testground-image.nix { };
})
];
overlays.default =
[
(import ./nix/build_overlay.nix)
poetry2nix.overlays.default
gomodOverlay
(import ./testground/benchmark/overlay.nix)
(final: super: {
go = super.go_1_25;
test-env = final.callPackage ./nix/testenv.nix { };
cronos-matrix = final.callPackage ./nix/cronos-matrix.nix {
inherit rev;
bundle-exe = final.pkgsBuildBuild.callPackage nix-bundle-exe { };
};
testground-image = final.callPackage ./nix/testground-image.nix { };
})
];
};
}
6 changes: 3 additions & 3 deletions nix/build_overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ let
if len == 0 then [ ] else final.lib.lists.take (len - 1) l ++ [ newVal ];
in
{
go_1_23 = super.go_1_23.overrideAttrs (old: rec {
version = "1.23.12";
go_1_25 = super.go_1_25.overrideAttrs (old: rec {
version = "1.25.0";
src = final.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-4czpN5ok6JVxSkEsfd0VfSYU2e2+g6hESbbhhAtPEiY=";
hash = "sha256-S9AekSlyB7+kUOpA1NWpOxtTGl5DhHOyoG4Y4HciciU=";
};
});
rocksdb = final.callPackage ./rocksdb.nix { };
Expand Down
21 changes: 17 additions & 4 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,30 @@ import sources.nixpkgs {
dapptools-master = sources.dapptools-master;
})
(_: pkgs: {
go = pkgs.go_1_23;
go = pkgs.go_1_25;
go-ethereum = pkgs.callPackage ./go-ethereum.nix {
inherit (pkgs.darwin) libobjc;
inherit (pkgs.darwin.apple_sdk.frameworks) IOKit;
buildGoModule = pkgs.buildGo123Module;
buildGoModule = pkgs.buildGoModule;
};
flake-compat = import sources.flake-compat;
chain-maind = pkgs.callPackage sources.chain-main { rocksdb = null; };
}) # update to a version that supports eip-1559
(import "${sources.poetry2nix}/overlay.nix")
(import "${sources.gomod2nix}/overlay.nix")
(
final: prev:
let
gomodSrc = sources.gomod2nix;
callPackage = final.callPackage;
in
{
inherit (callPackage "${gomodSrc}/builder" { }) buildGoApplication mkGoEnv mkVendorEnv;
gomod2nix =
(callPackage "${gomodSrc}/default.nix" { }).overrideAttrs (_: {
modRoot = ".";
});
}
)
(
pkgs: _:
import ./scripts.nix {
Expand Down Expand Up @@ -65,7 +78,7 @@ import sources.nixpkgs {
(_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; })
(_: pkgs: { cosmovisor = pkgs.callPackage ./cosmovisor.nix { }; })
(_: pkgs: {
rly = pkgs.buildGo123Module rec {
rly = pkgs.buildGoModule rec {
name = "rly";
src = sources.relayer;
subPackages = [ "." ];
Expand Down
5 changes: 3 additions & 2 deletions nix/golangci-lint.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
buildGo123Module,
buildGoModule,
fetchFromGitHub,
lib,
installShellFiles,
go_1_25,
}:

buildGo123Module rec {
(buildGoModule.override { go = go_1_25; }) rec {
pname = "golangci-lint";
version = "2.1.6";

Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-24.11",
"branch": "release-25.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "112c247873ba67732a9dd2563cb3d7b7749a82df",
"sha256": "00ghsa6842lkd0c0k0ln6531inq03y4m0nphczwnhf5n9g72sddh",
"rev": "f27d6578053dfba71ffe5156a8274a552340b730",
"sha256": "1bbm0v081qih6ksqjdqisw452wky8jzx5yi961m0w2vfy3zaqmhb",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/112c247873ba67732a9dd2563cb3d7b7749a82df.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/f27d6578053dfba71ffe5156a8274a552340b730.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"poetry2nix": {
Expand Down
Loading