File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ packages = [
11
11
" mdsh" ,
12
12
]
13
13
14
+ # Expose all the dependencies from a package to the environment.
15
+ packagesFrom = [
16
+ " direnv"
17
+ ]
18
+
14
19
# Message Of The Day (MOTD) is displayed when entering the environment with an
15
20
# interactive shell. By default it will show the project name.
16
21
#
Original file line number Diff line number Diff line change 116
116
'' ;
117
117
} ;
118
118
} ;
119
+
120
+ # Returns a list of all the input derivation ... for a derivation.
121
+ inputsOf = drv :
122
+ ( drv . buildInputs or [ ] ) ++
123
+ ( drv . nativeBuildInputs or [ ] ) ++
124
+ ( drv . propagatedBuildInputs or [ ] ) ++
125
+ ( drv . propagatedNativeBuildInputs or [ ] )
126
+ ;
119
127
in
120
128
{
121
129
options = {
215
223
'' ;
216
224
} ;
217
225
226
+ packagesFrom = mkOption {
227
+ type = types . listOf strOrPackage ;
228
+ default = [ ] ;
229
+ description = ''
230
+ Add all the build dependencies from the listed packages to the
231
+ environment.
232
+ '' ;
233
+ } ;
234
+
218
235
} ;
219
236
220
237
config = {
230
247
] ;
231
248
232
249
packages =
233
- builtins . filter
234
- ( x : x != null )
235
- ( map ( x : x . package ) config . commands ) ;
250
+ # Get all the packages from the commands
251
+ builtins . filter ( x : x != null ) ( map ( x : x . package ) config . commands )
252
+ # Get all the packages from packagesFrom
253
+ ++ builtins . foldl' ( sum : drv : sum ++ ( inputsOf drv ) ) [ ] config . packagesFrom
254
+ ;
236
255
} ;
237
256
}
You can’t perform that action at this time.
0 commit comments