-
Notifications
You must be signed in to change notification settings - Fork 6
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 flake #53
base: main
Are you sure you want to change the base?
Add nix flake #53
Conversation
This enables building via `nix build` and running via `nix run github:siddhantac/puffin` (once merged)
I don't have any experience with nix. Please give me some time to review this. Could you explain how this would change the release process? Or is the change limited to the 2 nix files? |
Of course, take your time. I think it would also be reasonable to just leave this open and see if there is more demand or how your thoughts develop. The nix file is not included in the go release, so all your existing processes still work and will keep working even if the flake wasn't updated at all. To keep the nix part working, you would have to do these steps every time a go dependency is added, removed or updated:
Re-running the docker command now succeeds. (It's not very verbose though, but it ends with something like Using docker allows you to update it without having nix installed on your system, but prevents caching since the container is discarded after the build. That said, on my system with a good uplink it takes about 23 seconds. Having said all of this, if I were you, I wouldn't merge this unless you're interested in getting into nix. I think it's perfectly fine to leave this open or even close it and let it be an artifact of this discussion. Either way, it will provide you and other interested people an example of how to do it. |
Thanks for the detailed explanation! I would like to make the application as easy to use as possible for everyone, however adding a new release pipeline which deviates from the usual process might be a bit much at this stage. I do appreciate the effort and your understanding that this may not be high on the priority list to merge at the moment. Based on the steps you mentioned, it would be great if it could be automated and triggered by |
This enables building via
nix build
and running vianix run github:siddhantac/puffin
(once merged)Putting this here as a proposal and space for discussion. It is not exactly zero-cost:
In practice, this means replacing the vendorHash with an empty string and running
nix build
, this will show the correct vendorHash like so:The sha is basically used as a cache key, so if a new version in which the vendorHash wasn't updated is built on a system that already has the old dependencies cached, it will wrongly use the cache.
An obvious way to prevent this would be to run the build in the pipeline, I'd be happy to add that if that would tip the scales for you, but it's going beyond my personal needs so I'll wait for your thoughts on this.
Depending on how deep you want to get into this, nix could also be used to define the development environment and so on of course, but I was interested in this and was missing this part because it allows me not to think about compiling the application.