on iko/ghcjs-patch-master help sign in
Expose handling of git repos in tutorial (#713)
commita814a425f4c6215af72646049d466da0f919fc19 authorDomen Kožar <domen@dev.si> dateFri 19 Jun 2020, 11:14 (6 years ago) parente56bbb3
2 files changed+10−7
docs/tutorials/source-repository-hashes.md+9−7 mkdocs.yml+1
docs/tutorials/source-repository-hashes.md+9−7
@@ -1,4 +1,4 @@
1−# Source Repository Hashes
1+# Handling git repositories in projects
22
33Both `stack.yaml` and `cabal.project` files can contain references
44to git repositories containing the version of a particular package
@@ -24,8 +24,9 @@ $ nix-prefetch-git https://github.com/input-output-hk/haskell.nix.git bc01ebc05a
2424}
2525```
2626
27−If you have a cabal project add a `--sha256` comment to the
28−`cabal.project` file:
27+## Cabal.project
28+
29+Add a `--sha256` comment to the `cabal.project` file:
2930
3031```
3132source-repository-package
@@ -36,8 +37,9 @@ source-repository-package
3637 --sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
3738```
3839
39−If you have a stack project add a `# nix-sha256` comment to the
40−`stack.yaml` file:
40+## Stack
41+
42+Add a `# nix-sha256` comment to the `stack.yaml` file:
4143
4244```
4345extra-deps:
@@ -48,14 +50,14 @@ extra-deps:
4850 # nix-sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
4951```
5052
51−## sha256map
53+## Avoding modifying cabal.project and stack.yaml
5254
5355In some cases we cannot modify the `cabal.project` or `stack.yaml` file
5456to add sha256 comments. As an alternative we can pass in a `sha256map`
5557For instance pandoc includes a `cabal.project` file in hackage includes a
5658`source-package-reference` to `pandoc-citeproc`:
5759
58−```
60+```nix
5961{ haskell-nix, testSrc } :
6062let
6163 pandoc = haskell-nix.hackage-package {
mkdocs.yml+1
@@ -30,6 +30,7 @@ pages:
3030 - 'Getting Started': tutorials/getting-started.md
3131 - 'Creating a development environment': tutorials/development.md
3232 - 'Sourcing files only part of git repository using cleanGit': tutorials/clean-git.md
33+ - 'Handling git repositories in projects': tutorials/source-repository-hashes.md
3334 - 'Mapping non-Haskell dependencies to Nixpkgs': tutorials/pkg-map.md
3435 - 'Bumping Hackage and Stackage snapshots': tutorials/hackage-stackage.md
3536 - 'Materialization: Speeding up Nix evaluation': tutorials/materialization.md