Skip to content

Commit

Permalink
Problem: recent improvements in gomod2nix are not used (backport #518) (
Browse files Browse the repository at this point in the history
#525)

Closes: #517
  • Loading branch information
yihuang authored May 31, 2022
1 parent 47dfa99 commit fa61791
Show file tree
Hide file tree
Showing 6 changed files with 1,726 additions and 4,621 deletions.
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, buildGoApplication
, nix-gitignore
, go_1_17
, rocksdb ? null
, db_backend ? "rocksdb"
, network ? "mainnet" # mainnet|testnet
Expand Down Expand Up @@ -38,6 +39,7 @@ buildGoApplication rec {
"!go.sum"
"!gomod2nix.toml"
] ./.);
go = go_1_17;
modules = ./gomod2nix.toml;
pwd = src; # needed to support replace
subPackages = [ "cmd/cronosd" ];
Expand Down
25 changes: 6 additions & 19 deletions flake.lock

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

9 changes: 4 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-21.11";
flake-utils.url = "github:numtide/flake-utils";
nix-bundle-exe = {
url = "github:3noch/nix-bundle-exe";
flake = false;
};
gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
};
flake-utils.url = "github:numtide/flake-utils";
rocksdb-src = {
url = "github:facebook/rocksdb/v6.29.5";
flake = false;
Expand All @@ -30,6 +31,7 @@
pkgs = import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
self.overlay
];
config = { };
Expand All @@ -46,7 +48,7 @@
devShells = {
cronosd = pkgs.mkShell {
buildInputs = with pkgs; [
go
go_1_17
rocksdb
gomod2nix
];
Expand All @@ -57,9 +59,6 @@
)
) // {
overlay = final: prev: {
buildGoApplication = final.callPackage (import (gomod2nix + "/builder")) {
go = final.go_1_17;
};
bundle-exe = import nix-bundle-exe { pkgs = final; };
# make-tarball don't follow symbolic links to avoid duplicate file, the bundle should have no external references.
# reset the ownership and permissions to make the extract result more normal.
Expand Down
Loading

0 comments on commit fa61791

Please sign in to comment.