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
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
higgsfield-cli = import ./overlays/higgsfield-cli.nix;
multica = import ./overlays/multica.nix;
herdr = import ./overlays/herdr.nix;
gno = import ./overlays/gno.nix;
gno-indexer = import ./overlays/gno-indexer.nix;
p = import ./overlays/p.nix;
mcp-nhost = _: prev: {
mcp-nhost = inputs.mcp-nhost.packages.${prev.stdenv.system}.mcp-nhost;
Expand Down
54 changes: 54 additions & 0 deletions overlays/gno-indexer.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
final: prev:
let
pkgs = prev;
version = "1.2.1";

systems = {
"aarch64-darwin" = {
suffix = "darwin_arm64";
hash = "sha256-lSbnJ10CgO5xnXRxy+WKSe9BR4vJORLSwccmgbwq2sw=";
};
"x86_64-darwin" = {
suffix = "darwin_amd64";
hash = "sha256-Mw+lhATwOIdPhLEkkymUjR8SbJqQZSDHeD+QDQfr4Z4=";
};
"aarch64-linux" = {
suffix = "linux_arm64";
hash = "sha256-eODySHajk/amremdOYyqOHjVTki7a4Tqu1NrGPhaVzM=";
};
"x86_64-linux" = {
suffix = "linux_amd64";
hash = "sha256-s8wTJgIqAbBvlwCrfl5xOcop4X2DTO+9/VG+fw4N4sk=";
};
};

source =
systems.${pkgs.stdenv.hostPlatform.system}
or (throw "gno-indexer: unsupported platform ${pkgs.stdenv.hostPlatform.system}");
in
{
gno-indexer = pkgs.stdenvNoCC.mkDerivation {
pname = "gno-indexer";
inherit version;

src = pkgs.fetchurl {
url = "https://github.com/gnolang/tx-indexer/releases/download/v${version}/tx-indexer_${version}_${source.suffix}.tar.gz";
inherit (source) hash;
};

sourceRoot = ".";

installPhase = ''
install -Dm755 tx-indexer "$out/bin/tx-indexer"
'';

meta = {
description = "Tendermint2 indexer for Gno.land chains";
homepage = "https://github.com/gnolang/tx-indexer";
license = pkgs.lib.licenses.asl20;
mainProgram = "tx-indexer";
platforms = builtins.attrNames systems;
sourceProvenance = [ pkgs.lib.sourceTypes.binaryNativeCode ];
};
};
}
173 changes: 173 additions & 0 deletions overlays/gno.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
final: prev:
let
pkgs = prev;

systems = {
"aarch64-darwin" = "darwin_arm64";
"x86_64-darwin" = "darwin_amd64";
"aarch64-linux" = "linux_arm64";
"x86_64-linux" = "linux_amd64";
};

mkReleaseTool =
{
version,
name,
hashes,
}:
let
system = pkgs.stdenv.hostPlatform.system;
suffix = systems.${system} or (throw "gno: unsupported platform ${system}");
in
pkgs.stdenvNoCC.mkDerivation {
pname = "gno-${name}";
inherit version;

src = pkgs.fetchurl {
url = "https://github.com/gnolang/gno/releases/download/v${version}/${name}_${suffix}";
hash = hashes.${system};
};

dontUnpack = true;

installPhase = ''
install -Dm755 "$src" "$out/bin/${name}"
'';

meta = {
homepage = "https://github.com/gnolang/gno";
license = pkgs.lib.licenses.gpl3Only;
mainProgram = name;
platforms = builtins.attrNames hashes;
sourceProvenance = [ pkgs.lib.sourceTypes.binaryNativeCode ];
};
};

mkTools =
packages:
pkgs.symlinkJoin {
name = "gno-tools-${packages.gno.version}";
paths = builtins.attrValues packages;
passthru = packages;
};

gnoFromRelease =
{
version,
hashes,
}:
let
packages = builtins.listToAttrs (
map
(name: {
inherit name;
value = mkReleaseTool {
inherit version name;
hashes = hashes.${name};
};
})
[
"gno"
"gnokey"
"gnoland"
"gnodev"
"gnoweb"
]
);
in
mkTools packages;

gnoFromSource =
{
rev,
hash,
version ? rev,
rootVendorHash,
gnodevVendorHash,
}:
let
src = pkgs.fetchFromGitHub {
owner = "gnolang";
repo = "gno";
inherit rev hash;
};

root = pkgs.buildGoModule {
pname = "gno-tools-source";
inherit version src;

subPackages = [
"gno.land/cmd/gnoland"
"gno.land/cmd/gnokey"
"gno.land/cmd/gnoweb"
"gnovm/cmd/gno"
];

vendorHash = rootVendorHash;
env.CGO_ENABLED = 0;
};

gnodev = pkgs.buildGoModule {
pname = "gnodev";
inherit version src;
modRoot = "contribs/gnodev";
subPackages = [ "." ];
vendorHash = gnodevVendorHash;
env.CGO_ENABLED = 0;
};
in
pkgs.symlinkJoin {
name = "gno-tools-${version}";
paths = [
root
gnodev
];
passthru = {
inherit gnodev root src;
inherit version;
};
};

releaseVersion = "1.5.0";
releaseHashes = {
gno = {
"aarch64-darwin" = "sha256-gewtLcxBNzW0GEBWMC0XqentzrNGgxepBh73OyeS4MM=";
"x86_64-darwin" = "sha256-LylGI+LsLg+mXg2nzYHL+na2y74dZnj1Pm20MTOo6Nk=";
"aarch64-linux" = "sha256-4JZabKMTeL4OwOHHTf3iJiapiAWTdML8z60n+jybLiE=";
"x86_64-linux" = "sha256-Zk0WBe+LRRxerHyYAHvxu5VbG84Sr+QtqcJoSpiOaQk=";
};
gnokey = {
"aarch64-darwin" = "sha256-qGOk6PrYxLXKgmnpIqXz+Qku5Wy9oMPAMYAGtGDVEbk=";
"x86_64-darwin" = "sha256-fu1egumi7GJlA44Y7ALRD+LySzhN/8lEvL3zreT+s28=";
"aarch64-linux" = "sha256-qHl8xt99rO7Jc8T3ge3bnzTQd37wcV5FCEntTnqavrs=";
"x86_64-linux" = "sha256-h462WZFh9JGjf9y9QhRHetKNXWII+EKPC//NMRXNNbQ=";
};
gnoland = {
"aarch64-darwin" = "sha256-iungqGlsNdmWYJCn4VYCLH3mlOH7vPAam6BY6ngMQas=";
"x86_64-darwin" = "sha256-WvhuMvXZF5TwMulHyA3G/K3MEaAuOuHjLePOhNqL3gE=";
"aarch64-linux" = "sha256-3eO7OQwt+fGOL3dsJAu4PDI1gTHH29vgSnFoVfV5t6U=";
"x86_64-linux" = "sha256-jc/0giiogeOY0jjj4UdgwXXIcvsWToXyHltO6UqLB20=";
};
gnodev = {
"aarch64-darwin" = "sha256-hLbb39QNpTPPX5rgYpfboevtMrX0tTTUgCixgJn9WVc=";
"x86_64-darwin" = "sha256-I4Bkt8/I4myO6TYhkVhnybFKDC3pvoVYZm9Ney9e6eU=";
"aarch64-linux" = "sha256-COgPywFaaVrDdtCh+zJqggbvwCKHuu8Y7Hr1urLeZG0=";
"x86_64-linux" = "sha256-v9dG551njDLlpUTO35Pt0gz3aqtMHUved/lZMFq491M=";
};
gnoweb = {
"aarch64-darwin" = "sha256-JYq/2dahYgsGezkp4DqxgdQvfk+qw5XlZnPcgWllAYQ=";
"x86_64-darwin" = "sha256-70GSxmuRP+nrKhYIzduFN0i79GPNyAf3ptDRsh1GosY=";
"aarch64-linux" = "sha256-j+TbUsXO2PRhaOJix7oiOo6wIGuhzEPVu90Y2Rm+zaw=";
"x86_64-linux" = "sha256-LlyugAhd8pmUl3sR2DO31+J53fx2PtwJ7PWVpgNdg/w=";
};
};
in
{
gnoFromRelease = gnoFromRelease;
gnoFromSource = gnoFromSource;

gno-tools = gnoFromRelease {
version = releaseVersion;
hashes = releaseHashes;
};
}
Loading