on iko/ghcjs-patch-master help sign in
Expose handling of git repos in tutorial (#713)
a814a42Domen Kožar
docs/tutorials/source-repository-hashes.md+9−7
@@ -1,4 +1,4 @@
1−# Source Repository Hashes
1+# Handling git repositories in projects
2
2
3Both `stack.yaml` and `cabal.project` files can contain references
3Both `stack.yaml` and `cabal.project` files can contain references
4to git repositories containing the version of a particular package
4to 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
24}
24}
25```
25```
26
26
27−If you have a cabal project add a `--sha256` comment to the
27+## Cabal.project
28+
28−`cabal.project` file:
29+Add a `--sha256` comment to the `cabal.project` file:
29
30
30```
31```
31source-repository-package
32source-repository-package
@@ -36,8 +37,9 @@ source-repository-package
36 --sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
37 --sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
37```
38```
38
39
40+## Stack
41+
39−If you have a stack project add a `# nix-sha256` comment to the
42+Add a `# nix-sha256` comment to the `stack.yaml` file:
40−`stack.yaml` file:
41
43
42```
44```
43extra-deps:
45extra-deps:
@@ -48,14 +50,14 @@ extra-deps:
48 # nix-sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
50 # nix-sha256: 003lm3pm024vhbfmii7xcdd9v2rczpflxf7gdl2pyxia7p014i8z
49```
51```
50
52
51−## sha256map
53+## Avoding modifying cabal.project and stack.yaml
52
54
53In some cases we cannot modify the `cabal.project` or `stack.yaml` file
55In some cases we cannot modify the `cabal.project` or `stack.yaml` file
54to add sha256 comments. As an alternative we can pass in a `sha256map`
56to add sha256 comments. As an alternative we can pass in a `sha256map`
55For instance pandoc includes a `cabal.project` file in hackage includes a
57For instance pandoc includes a `cabal.project` file in hackage includes a
56`source-package-reference` to `pandoc-citeproc`:
58`source-package-reference` to `pandoc-citeproc`:
57
59
58−```
60+```nix
59{ haskell-nix, testSrc } :
61{ haskell-nix, testSrc } :
60let
62let
61 pandoc = haskell-nix.hackage-package {
63 pandoc = haskell-nix.hackage-package {
mkdocs.yml+1
@@ -30,6 +30,7 @@ pages:
30 - 'Getting Started': tutorials/getting-started.md
30 - 'Getting Started': tutorials/getting-started.md
31 - 'Creating a development environment': tutorials/development.md
31 - 'Creating a development environment': tutorials/development.md
32 - 'Sourcing files only part of git repository using cleanGit': tutorials/clean-git.md
32 - 'Sourcing files only part of git repository using cleanGit': tutorials/clean-git.md
33+ - 'Handling git repositories in projects': tutorials/source-repository-hashes.md
33 - 'Mapping non-Haskell dependencies to Nixpkgs': tutorials/pkg-map.md
34 - 'Mapping non-Haskell dependencies to Nixpkgs': tutorials/pkg-map.md
34 - 'Bumping Hackage and Stackage snapshots': tutorials/hackage-stackage.md
35 - 'Bumping Hackage and Stackage snapshots': tutorials/hackage-stackage.md
35 - 'Materialization: Speeding up Nix evaluation': tutorials/materialization.md
36 - 'Materialization: Speeding up Nix evaluation': tutorials/materialization.md