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 = [
1111 " mdsh" ,
1212]
1313
14+ # Expose all the dependencies from a package to the environment.
15+ packagesFrom = [
16+ " direnv"
17+ ]
18+
1419# Message Of The Day (MOTD) is displayed when entering the environment with an
1520# interactive shell. By default it will show the project name.
1621#
Original file line number Diff line number Diff line change 116116 '' ;
117117 } ;
118118 } ;
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+ ;
119127in
120128{
121129 options = {
215223 '' ;
216224 } ;
217225
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+
218235 } ;
219236
220237 config = {
230247 ] ;
231248
232249 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+ ;
236255 } ;
237256}
You can’t perform that action at this time.
0 commit comments