-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: develop
Are you sure you want to change the base?
Add Flake #1502
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This adds a
flake.nix
.The program can be built with
nix build
, the Docker image withnix build .#dockerImage
.