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: |
| @@ -0,0 +1,124 @@ | |||
| { | |||
| description = "Build teos (The Eyes of Satoshi) server and plugin"; | |||
| pkgs.libiconv | ||
| ]; | ||
|
|
||
| # TODO: hack but without there are warnings and I can't make other method work |
There was a problem hiding this comment.
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.
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.
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? |
jonasnick
left a comment
There was a problem hiding this comment.
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.
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.
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.
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-commandandflakeare required, either enabled via the command or globally