Stream: Nix toolbox devs & users

Topic: Flake support


view this post on Zulip Arthur Azevedo de Amorim (Aug 23 2022 at 14:38):

Is there any way of using mkCoqDerivation inside of a flake? When I try to do so, it complains that I am trying to fetch a tarball without providing a sha256.

A bit of context: I have been developing a few packages that are not ready yet to be published in nixpkgs. I wanted to reference those packages from other projects without having to manually specify which commit I want to use. This seems to be one of the main use cases for flakes, though I would be willing to try other approaches if you have any ideas.

view this post on Zulip Théo Zimmermann (Aug 23 2022 at 16:03):

Sorry, I cannot help on flakes because I have no experience (and very limited knowledge) of them. I think Cyril is also not a flake user. However, I can mention that the Coq Nix Toolbox allows you to introduce local overlays for depending on other packages that are not yet part of nixpkgs. You do not have to pin a specific commit. You can reference a branch too.

view this post on Zulip Arthur Azevedo de Amorim (Aug 23 2022 at 18:00):

That's nice. Is there a convenient way of sharing the overlaying code with other people other than copying and pasting? I haven't really used it before, so I do not know how it works.

view this post on Zulip Ali Caglayan (Aug 24 2022 at 08:18):

I would like to add flake support to the main Coq repo, though I have no experience doing so

view this post on Zulip Ali Caglayan (Aug 24 2022 at 08:18):

But if I've understood the Nix doc correctly, all I need to do is add flakes for all projects and they should compose

view this post on Zulip Ali Caglayan (Aug 24 2022 at 08:19):

Would this basically be replacing the Coq Nix toolbox?

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:26):

Arthur Azevedo de Amorim said:

That's nice. Is there a convenient way of sharing the overlaying code with other people other than copying and pasting? I haven't really used it before, so I do not know how it works.

Copy-pasting is the simplest way until something gets into nixpkgs. The good point is that verbatim copy-paste should work. Another way of course is to pin nixpkgs to a fork branch with the new package definitions.

view this post on Zulip Enrico Tassi (Aug 24 2022 at 08:26):

Do flakes generate gh actions?

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:26):

Nope

view this post on Zulip Enrico Tassi (Aug 24 2022 at 08:27):

Then they are useless

view this post on Zulip Enrico Tassi (Aug 24 2022 at 08:28):

The whole point of the toolbox (for me) is to be able to test reverse dependencies in my CI

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:28):

Sure, they do not bring the same benefits.

view this post on Zulip Enrico Tassi (Aug 24 2022 at 08:28):

And you need overlays since you want to be able to patch your users

view this post on Zulip Enrico Tassi (Aug 24 2022 at 08:29):

Maybe these overlays can be replaced by flakes, I don't know, but generating gh actions is, IMO, the feature of the nix toolbox

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:30):

That's certainly the main feature that most users benefit from, but it's not the only one that probably couldn't be replaced easily by flakes. You also have the possibility of easily testing various dependency and reverse dependency versions locally (from which the CI feature derives), etc.

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:32):

@Ali Caglayan I should note that I never really completed the job of introducing the Coq Nix Toolbox into the main Coq repository by lack of time. The Nix infrastructure that is currently in there is not nearly as nice.

view this post on Zulip Théo Zimmermann (Aug 24 2022 at 08:33):

Cf. an attempt at https://github.com/coq/coq/pull/14435. But retrospectively, I think that I should just have used the GitHub Actions generating feature and ditched GitLab for Nix testing in the process.


Last updated: Mar 29 2024 at 06:39 UTC