-
Notifications
You must be signed in to change notification settings - Fork 906
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
Nix flake #6650
Nix flake #6650
Conversation
defines a default package: - pname is now "cln" because why not - version uses flake input metadata, doesn't match git describe format building requires submodules: nix build ".?submodules=1" the devshell does not, project can be built from checkout with submodules in this devshell.
1da05ff
to
4299e8e
Compare
4299e8e
to
cfed4d4
Compare
description = "A very basic flake"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/23.05"; |
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.
To use the unstable branch, FYI this currently causes an infinite cascade of derivations due to a breaking change in the nixpkgs python stuff that poetry2nix uses, you would need to pin nixpkgs to just before the merging PR mentioned in this thread:
https://discourse.nixos.org/t/psa-poetry2nix-is-currently-broken-with-nixpkgs-unstable/32281
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.
we probably shouldn't use unstable anyway since it would reevaluate packages every time, not a great UX. Pinning it to the latest stable release seems ok.
We could also figure out which packages we want bleeding edge for and cherry pick those from nixpkgs-unstable, like nix-bitcoin does.
thanks for kicking this off!
|
Does anyone know of a good repo to look at for an example of what to do here? @jurraca @nothingmuch The goal is to be able to type Even something without python would work, I'm just trying to get my bearings right now. Will add Then I'll add the ability to run this from downstream repos, ie plugins that also need the |
yep, that's a hack, only intended (i should have clarified this) to delay making some decisions until later but should not be merged as such since it spreads out knowledge about what is appropriate to do to build the project in a very inconvenient way, introducing a dep on nixpkgs at the wrong level of abstraction (edit: that is, in addition to the appropriate dep on nixpkgs, namely relying on it for (native) build inputs)
i would only add to this that it's not just CLN proper but plugin development too that should be facilitated, regardless of whether the plugin lives in this repo or outside of it |
not off the top of my head
that's what i was going for in the first commit but it's somewhat incomplete
python is important IMO because of make check |
FWIW I was able to side-step the requirement for poetry2nix altogether by adding a shell hook that'd just invoke What do you think @nothingmuch ? |
@cdecker do you have a link to your flake handy? would love to take a look! |
I'm afraid I have it committed in some random branch that I am having trouble finding again 😊 But I will share as soon as I find it. |
I just tried this out. Flake loads once I update it to 24.05, but then I get a stack overflow when building. I can't really help with the C/Make/python stuff but I can write crane based rust derivations. |
@JosephGoulden can you post the error? Would love to resurrect this and get it working... I can jump on a call to collaborate! |
Lots of logs about instantiating python stuff then a stack overflow.
|
Hmm I'm not even getting past
Did you modify anything to get the dev shell loading? |
Yeah I got the same error at first. I updated Probably worth trying a rebase after that given the branch is nearly a year old. |
Hmm @JosephGoulden I tried your change, but i get this: Took like 40GB of RAM before erroring out here xD Wonder what that's about |
Tried just getting rid of the flake.lock file and i get this:
Just kinda shooting in the dark here |
If you change I did a rebase as well then get stuck at |
Not sure how you're getting that. I'm getting this:
|
I think we should try a slightly different approach. I created a new PR #7656 which is quite similar to the first commit in this PR. |
Closing with PR #7656. |
per @chrisguida's request, cc @jurraca, opening a draft PR for a new flake.nix
disabling
doCheck = true
is enough to build from source usingnix build ".?submodules=1"
, and innix develop
the python interpreter is set up with the poetry dependencies, but that's as far as I got, this does not yet work.TODO:
callPackages
python override from poetry2nix built environment is not doing the right thing, currently there's an ugly workaround (prepending to nativeBuildInputs)contrib
(do they need separate derivations?)doCheck
in derivation workingnixpkgs.poetry
(poetry itself is not supposed to be a dep of pyproject.toml)git rebase --exec 'nix flake check'
pretty reasonable