[Nix-dev] Re: builtins.ls
Yury G. Kudryashov
urkud+nix at ya.ru
Thu Aug 19 02:11:12 CEST 2010
Marc Weber wrote:
> Excerpts from Yury G. Kudryashov's message of Wed Aug 18 22:10:41 +0200
> 2010:
>> Hi!
>>
>> What do you think about introducing
>> builtins.ls pathToDirectory = [ file1 file2 ] # in alphabetical order
>>
>> This would allow, e.g., automatic exporting of all nix expressions in a
>> given foler (possibly including subfolders).
>
> Can you give some more details? What do you mean by exporting?
> do you want to export the closure (build results) ?
Sorry, importing.
I mean something like this
builtins.listToAttrs
map (x : { name = x; value = callPackage x { name = basenameOf x; }; })
(builtins.ls ./)
should allow me to export all main kde modules without explicit listing.
And some more magic (for recursive traversal) should replace `find . ...`-
generated files like /etc/nixos/nixos/modules/module-list.nix.
>
> Sorry, I'm unable to understand what you're proposing at the moment.
>
> Marc Weber
More information about the nix-dev
mailing list