]> Git — Sourcephile - gargantext.git/commit
build: add nix flake support
authorJulien Moutinho <julm+gargantext@sourcephile.fr>
Mon, 26 Jun 2023 19:23:12 +0000 (21:23 +0200)
committerJulien Moutinho <julm+gargantext@sourcephile.fr>
Fri, 7 Jul 2023 14:54:14 +0000 (16:54 +0200)
commit7b4869b771882d71cd910c2e00f48d75ee05b1c9
treec14e9c2ed133a6c232245f7b4f2c2063ca5ec324
parent17ba88468a183cbddd557913f05920c9caea9f6d
build: add nix flake support

Main motivations for using a `flake.nix`:
- To simplify managing inputs that we need to lock
  (e.g. Nixpkgs and some haskellPackages).
- To speed up the loading of the developing shell.
See last stage of:
https://www.haskellforall.com/2022/08/incrementally-package-haskell-program.html

To load a shell: `nix -L develop` or `direnv allow`,
this will get reachable all the dependencies needed through the environment,
then `cabal repl` can work.

To update a dependency: `nix flake lock --update-input nixpkgs`

To update all dependencies: `nix flake update`

WARNING: Please review the WARNING comments about the use of a non primary branch
for several dependencies, they're at the exact commit frozen in `stack.yaml`

WARNING: Please review the patches in the `patches/` directory,
some should be pushed upstream, but may require a bit more care
to support backward compatibility:
- patches/accelerate-arithmetic/0001-remove-test-using-removed-realBandedGramian.patch
- patches/arxiv-api/0001-build-fix-license.patch
- patches/crawlerPubMed/0001-fix-test-suite-build-dependencies.patch
- patches/duckling/0001-fix-missing-Eq-Dimension-a-needed-by-recent-hashable.patch
- patches/duckling/0002-support-and-require-aeson-2.0.patch
- patches/ekg-json/0001-support-and-require-aeson-2.0.patch
- patches/hal/0001-build-fix-halCrawler-crawlerHAL.patch
- patches/patches-class/0001-fix-comment-that-confused-GHC-because-of-haddock-syn.patch
- patches/servant-ekg/0001-fix-missing-instance-HasEndpoint.patch
- patches/servant-job/0001-fix-comment-breaking-haddock.patch

Some may contain questionnable changes:
eg. `patches/accelerate-llvm-native/0001-fix-removed-argInt-by-using-argInt64.patch`

Some come from upstream but are not merged yet:
- patches/opaleye/PR-563.patch

NOTE: `pre-commit-hooks` is enabled, but only on `.nix` files so far.
It generates `.pre-commit-config.yaml` and `.git/hooks/pre-commit`.
17 files changed:
.envrc
.gitignore
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]
gargantext.cabal
patches/accelerate-arithmetic/0001-remove-test-using-removed-realBandedGramian.patch [new file with mode: 0644]
patches/accelerate-llvm-native/0001-fix-removed-argInt-by-using-argInt64.patch [new file with mode: 0644]
patches/arxiv-api/0001-build-fix-license.patch [new file with mode: 0644]
patches/crawlerPubMed/0001-fix-test-suite-build-dependencies.patch [new file with mode: 0644]
patches/duckling/0001-fix-missing-Eq-Dimension-a-needed-by-recent-hashable.patch [new file with mode: 0644]
patches/duckling/0002-support-and-require-aeson-2.0.patch [new file with mode: 0644]
patches/ekg-json/0001-support-and-require-aeson-2.0.patch [new file with mode: 0644]
patches/hal/0001-build-fix-halCrawler-crawlerHAL.patch [new file with mode: 0644]
patches/opaleye/PR-563.patch [new file with mode: 0644]
patches/patches-class/0001-fix-comment-that-confused-GHC-because-of-haddock-syn.patch [new file with mode: 0644]
patches/servant-ekg/0001-fix-missing-instance-HasEndpoint.patch [new file with mode: 0644]
patches/servant-job/0001-fix-comment-breaking-haddock.patch [new file with mode: 0644]