@@ -4,11 +4,11 @@ what you get when importing [Haskell.nix][]. It might be helpful to
4
4
load the library in the [ Nix REPL] ( ../tutorials/development.md#using-nix-repl ) to
5
5
test things.
6
6
7
- * [ Types ] ( #types ) — the kinds of data that you will encounter working with [ Haskell.nix] [ ] .
7
+ * [ Data structures ] ( #data-structures ) — the kinds of data that you will encounter working with [ Haskell.nix] [ ] .
8
8
* [ Top-level attributes] ( #top-level-attributes ) — Functions and derivations defined in the Haskell.nix attrset.
9
9
* [ Package-set functions] ( #package-set-functions ) — Helper functions defined on the ` hsPkgs ` package set.
10
10
11
- # Types
11
+ # Data structures
12
12
13
13
## Package Set
14
14
@@ -116,6 +116,64 @@ will be passed to it:
116
116
117
117
# Top-level attributes
118
118
119
+ ## project
120
+
121
+ Function that accepts attribute set with a ` src ` attribute and looks for ` stack.yaml ` file relative to it.
122
+
123
+ If file exists, it calls [ stackProject] ( #stack-project ) function. Otherwise it will call [ cabalProject] ( #cabal-project ) function.
124
+
125
+ ** Example** :
126
+
127
+ ``` nix
128
+ pkgs.haskell-nix.project {
129
+ # 'cleanGit' cleans a source directory based on the files known by git
130
+ src = pkgs.haskell-nix.haskellLib.cleanGit {
131
+ name = "haskell-nix-project";
132
+ src = ./.;
133
+ };
134
+ }
135
+ ```
136
+
137
+ ## stackProject
138
+
139
+ A function calling [ callStackToNix] ( #callStackToNix ) with all arguments.
140
+
141
+ Then feeding its result into [ mkStackPkgSet] ( #mkStackPkgSet ) passing also
142
+ ` pkg-def-extras ` and ` modules ` arguments.
143
+
144
+ ** Return value** :
145
+
146
+ | Attribute | Type | Description |
147
+ | -------------------| --------------------------------------------------| ----------------------------------------------------------------------------|
148
+ | ` hsPkgs ` | Attrset of [ Haskell Packages] ( #haskell-package ) | Buildable packages, created from ` packages ` |
149
+ | ` pkg-set ` | Attrset | [ ` pkgSet ` ] ( #package-set ) |
150
+ | ` stack-nix ` | | ` projectNix ` attribute of [ ` callStackToNix ` ] ( #callStackToNix ) return value |
151
+ | ` shellFor ` | Function | [ ` shellFor ` ] ( #shellFor ) |
152
+ | ` ghcWithHoogle ` | Function | [ ` ghcWithHoogle ` ] ( #ghcWithHoogle ) |
153
+ | ` ghcWithPackages ` | Function | [ ` ghcWithPackages ` ] ( #ghcWithPackages ) |
154
+
155
+
156
+ ## cabalProject
157
+
158
+ A function calling [ callCabalProjectToNix] ( #callCabalProjectToNix ) with all arguments.
159
+
160
+ Then feeding its result into [ mkStackPkgSet] ( #mkStackPkgSet ) passing also
161
+ ` pkg-def-extras ` , ` extra-hackages ` and ` modules ` arguments.
162
+
163
+ ** Return value** :
164
+
165
+ | Attribute | Type | Description |
166
+ | -------------------| --------------------------------------------------| -----------------------------------------------------------------------------|
167
+ | ` hsPkgs ` | Attrset of [ Haskell Packages] ( #haskell-package ) | Buildable packages, created from ` packages ` |
168
+ | ` pkg-set ` | Attrset | [ ` pkgSet ` ] ( #package-set ) |
169
+ | ` plan-nix ` | | ` projectNix ` attribute of [ ` callCabalProjectToNix ` ] ( #callcabalprojecttonix ) return value |
170
+ | ` index-state ` | | ` index-state ` attribute of [ ` callCabalProjectToNix ` ] ( #callcabalprojecttonix ) return value |
171
+ | ` shellFor ` | Function | [ ` shellFor ` ] ( #shellfor ) |
172
+ | ` ghcWithHoogle ` | Function | [ ` ghcWithHoogle ` ] ( #ghcwithhoogle ) |
173
+ | ` ghcWithPackages ` | Function | [ ` ghcWithPackages ` ] ( #ghcwithpackages ) |
174
+
175
+
176
+
119
177
## mkStackPkgSet
120
178
121
179
Creates a [ package set] ( #package-set ) based on the ` pkgs.nix ` output
0 commit comments