smos
smos copied to clipboard
Introduce Nix Flake
This adds a Nix flake for Smos.
Try it out: nix run github:vapourismo/smos/feature/flake#smos
The above requires experimental features to be enabled: nix-command flakes
Packages that depend on smos-stripe-client
weren't added.
GHC 9.0.2 has been picked as per stack.yaml
's LTS-19.6. The dependencies are pinned via Flake inputs using the repository and revision combinations in stack.yaml
.
Hey! I appreciate the effort but I cannot accept this yet while flakes are still experimental. There are other problems:
- That this isn't part of CI so there's no chance that this keeps working going forward
- There needs to be a solution for the stripe-client before I can use this
- At that point I can probably get rid of the old way of doing nix.
I'm happy to keep this PR open until flakes stabilise if it's useful to you though :)
No sweat. I think keeping it open is a good idea given the Flake can be useful for people who just want to try it out without wanting to meddle with Stack or the existing Nix stuff to get something running. However, I think it would also be open for quite a while if we're waiting for Flakes to become generally available :) Up to you.
As for the private dependencies, I don't think there is a good way for Flakes to handle this given all inputs are usually eagerly fetched. Hence even if the stripe client is optional, it must be available for download. Normally I would suggest splitting these components. I guess only the server-side components have private dependencies? You could have separate Flakes for the client and server. This way people can use the client part without problems.
For the existing Nix stuff, I think that can be greatly simplified. Not sure how open you are to that, but one can almost effortlessly convert this Flake into vanilla Nix stuff.
@vapourismo There are no private dependencies. The stripe client is generated at build time :D See the scripts directory.
Flakes should become non-experimental in the next nix/nixos release, I'm told. So that's in three months.
In that case it is probably easiest to generate it and commit to the repo. This requires a trivial check in CI, though.
I think generating it on the fly works too, but makes the development experience with Nix less nice if you need to modify and re-generate it.
Closing this in favour of https://github.com/NorfairKing/smos/pull/250