Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Flake #1502

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Add Flake #1502

wants to merge 9 commits into from

Conversation

asymmetric
Copy link

@asymmetric asymmetric commented Feb 20, 2022

This adds a flake.nix.

The program can be built with nix build, the Docker image with nix build .#dockerImage.

@asymmetric asymmetric marked this pull request as ready for review February 21, 2022 20:30
@codecov
Copy link

codecov bot commented Feb 24, 2022

Codecov Report

Merging #1502 (c314958) into develop (763173f) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Current head c314958 differs from pull request most recent head 6b13526. Consider uploading reports for the commit 6b13526 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1502      +/-   ##
===========================================
+ Coverage    68.69%   68.72%   +0.02%     
===========================================
  Files          131      131              
  Lines         9915     9927      +12     
===========================================
+ Hits          6811     6822      +11     
  Misses        2424     2424              
- Partials       680      681       +1     
Impacted Files Coverage Δ
documents/repository.go 92.40% <0.00%> (-0.28%) ⬇️
crypto/secp256k1/secp256k1.go 51.56% <0.00%> (+12.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 763173f...6b13526. Read the comment docs.

Copy link
Contributor

@mikiquantum mikiquantum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, same comment as the other PR

flake.nix Outdated

dockerImage = pkgs.dockerTools.buildLayeredImage {
name = "centrifugeio/${name}";
tag = version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we follow as well here the same format as mentioned in the centrifuge-chain PR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

in
{
packages.${system} = {
go-centrifuge = pkgs.buildGoModule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of same question as in the other PR, how to know the go version is used, probably part of the same presentation we have to shedule.

Copy link
Author

@asymmetric asymmetric Feb 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most basic way to know that is, is to:

  • inspect which commit of nixpkgs we're using in this repo, which is found in the flake.lock
  • Run nix run nixpkgs/$commit#go -- version

In this specific case:

❯ nix run nixpkgs/6f07605b6916abee5435ea1145a7541299a87c1b#go -- version
go version go1.16.9 linux/amd64

But I've also implemented a simpler solution, which works by dropping you in a shell where Go is installed. Since nixpkgs is pinned, this is the same Go used to build the app.

  • nix develop
  • go version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants