-
Notifications
You must be signed in to change notification settings - Fork 137
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 Nix flakes #800
Add Nix flakes #800
Conversation
@MatthiasHu Can you please take a look at this :-) |
Disclaimer: I am not familiar with nix flakes. :-) I successfully tested the flake by running: nix --extra-experimental-features "nix-command flakes" shell github:guilhermehas/cubical/7039feccf434861d16921522ebdf1bd2c3de5306 @guilhermehas Could you perhaps provide a minimal working example of how to import the library in another project via the flake file? |
cat << EOF > test.agda
{-# OPTIONS --cubical #-}
open import Cubical.Foundations.Prelude
EOF
nix --extra-experimental-features "nix-command flakes" shell github:guilhermehas/cubical/52dfed7b703e6294b7acd11244cd838480839367#agdaWithCubical
agda -l cubical -i . test.agda With these commands, I can use the cubical library of Agda. Do you want to document it in some file such as |
Maybe this would fit better in |
Thank you, @guilhermehas ! I agree that |
Also, a question about .github/workflows/ci-nix.yml: I assume that this CI job checks the whole library, as part of building the flake, which is already done by ci-ubuntu.yml. So does this mean that the library will be checked twice on every push to a pull request? Or perhaps only on every push to the master branch? I am not sure what the line |
I have put the instructions in |
I assume that the purpose of the Nix CI job is to check whether the (automatically generated) flake.lock file (which determines in particular the precise Agda version) needs to be updated after some changes to the library. If I understand you right, @guilhermehas, you would like this job to run (at least) whenever a PR is merged into master. Then this raises the question who is responsible for updating flake.lock when the Nix CI job fails. |
The procedure in the new section in INSTALL.md works for me. |
I think that we need just to update the lock file if the library is using a feature of a newer compiler. |
Is this ready to be merged now? @MatthiasHu Is there be anything us developers will have to do in the future for example when releasing a new version of the library when there is a new version of Agda out? @guilhermehas |
I tried to use this Agda flake, but it didn't work here. It looks like it is broken. I put |
Right, Maybe the most flexible option is to also provide an overlay, just like the agda flake does, so that people can use this with whichever nixpkgs and Agda they want. |
Ok, I can already now promise that I will forget to do this... Is there some way of doing this that doesn't require any effort for us developers? |
There is an action for automatically updating the lockfile and sending PRs: https://github.com/DeterminateSystems/update-flake-lock |
Also, whatever steps need to be taken could just be documented in RELEASE.md :) |
That would be great! |
@ncfavier I created an overlay. Look if it is good. |
I put the instructions in |
@guilhermehas : What is the status of this PR? Does it need more testing? |
For me, it is done and it does not need more testing. |
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've tested the Nix Flake, and it works as expected.
Apart from some minor issues, this looks ready to rebase, squash and merge.
@phijor : Thanks for joining! |
I merged the master to it. |
I assume the second, slow, apparently not cached ci job added by this PR is intended - I don't mind it since it doesn't seem to slow down the old ci job. |
@guilhermehas : Feel free to use the "Resolve conversation" button in the conversations above, if you think something is resolved. |
I clicked to resolve the conversation. |
Ok, then - looks like everything is resolved -> merging. |
With this flake file, it becomes easier to import this library into other projects.
This is based on:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/agda/default.nix
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/agda/cubical/default.nix