File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed
Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ name = "mkDevShell"
88# NOTE: don't forget to put commas between items! :)
99packages = []
1010
11+ # Expose all the dependencies from a package to the environment.
12+ packagesFrom = [
13+ " direnv"
14+ ]
15+
1116# Message Of The Day (MOTD) is displayed when entering the environment with an
1217# interactive shell. By default it will show the project name.
1318#
Original file line number Diff line number Diff line change 5050 '' ;
5151 } ;
5252 } ;
53+
54+ # Returns a list of all the input derivation ... for a derivation.
55+ inputsOf = drv :
56+ ( drv . buildInputs or [ ] ) ++
57+ ( drv . nativeBuildInputs or [ ] ) ++
58+ ( drv . propagatedBuildInputs or [ ] ) ++
59+ ( drv . propagatedNativeBuildInputs or [ ] )
60+ ;
5361in
5462{
5563 options = {
142150 '' ;
143151 } ;
144152
153+ packagesFrom = mkOption {
154+ type = types . listOf strOrPackage ;
155+ default = [ ] ;
156+ description = ''
157+ Add all the build dependencies from the listed packages to the
158+ environment.
159+ '' ;
160+ } ;
161+
145162 } ;
146163
147164 config = {
158175 ] ;
159176
160177 packages =
161- builtins . filter ( x : x != null )
162- ( map ( x : x . package ) config . commands ) ;
178+ # Get all the packages from the commands
179+ builtins . filter ( x : x != null ) ( map ( x : x . package ) config . commands )
180+ # Get all the packages from packagesFrom
181+ ++ builtins . foldl' ( sum : drv : sum ++ ( inputsOf drv ) ) [ ] config . packagesFrom
182+ ;
163183 } ;
164184}
You can’t perform that action at this time.
0 commit comments