-
Notifications
You must be signed in to change notification settings - Fork 63
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.nix #262
base: master
Are you sure you want to change the base?
add flake.nix #262
Conversation
Thanks! Could this tolerate being in a sub/nested directory (e.g. There are probably other package managers could build/use teos in a certain way. I imagine lots of these files in the projects root directory gonna be messy in the future. Maybe this could fit here: https://github.com/talaia-labs/rust-teos/tree/master/contrib |
Putting it in a sub-directory would prevent most of the usefulness. From the docs:
The standard position allows to run the executable also with this syntax:
|
flake.nix
Outdated
@@ -0,0 +1,124 @@ | |||
{ | |||
description = "Build teos (The Eyes of Satoshi) server and plugin"; |
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.
typo: Eyes -> Eye
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.
fixed
pkgs.libiconv | ||
]; | ||
|
||
# TODO: hack but without there are warnings and I can't make other method work |
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.
I'm curious about what the issue with this is. I'm not familiar with Nix so just wondering
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 issue is that changing the released version in Cargo.toml
require changing the version here, while instead the value should be read from the Cargo.toml
thus not requiring to keep this file in sync.
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.
Crane is expecting a version in the workspace Cargo.toml. So either you can add one or it won't be possible to build just the dependencies (without warnings).
@seberm you may be interested in this, given fort-nix/nix-bitcoin#543 Would you mind giving it a try if so? |
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.
Works for me, but I don't know if this flake.nix is idiomatic. There are a bunch of trailing whitespaces and a tab.
Is this fixable by running it though nixfmt? |
description = "Build teos (The Eye of Satoshi) server and plugin"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
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.
I prefer stability so better to point at nixos-24.05.
pkgs.libiconv | ||
]; | ||
|
||
# TODO: hack but without there are warnings and I can't make other method work |
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.
Crane is expecting a version in the workspace Cargo.toml. So either you can add one or it won't be possible to build just the dependencies (without warnings).
inherit cargoArtifacts; | ||
inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; | ||
# NB: we disable tests since we'll run them all via cargo-nextest | ||
doCheck = false; |
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.
No cargo-nextest check configured in the flake so remove this I think.
I added nixfmt as well. |
Please go ahead with a new one, thanks! |
This allow to build the project executables with
nix
.UPDATE: worth mentioning experimental features
nix-command
andflake
are required, either enabled via the command or globally