[Nix-dev] Re: builtins.ls

Marc Weber marco-oweber at gmx.de
Thu Aug 19 04:48:27 CEST 2010


Excerpts from Yury G. Kudryashov's message of Thu Aug 19 02:11:12 +0200 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).

abc/default.nix
def/default.nix

So you're too lazy to write 

{
  abc = callPackage abc;
  def = callPackage def;
}

?

I like the white listening we have.

When switching branches in git it may happen that you forgot to commit
fies - so you may have additional (orhpaned) files laying around.
I personally don't want orphaned files to affect the nix-* output in any
way.

So at the very least make sure that no REBASE or .nix.revXXX files are
considered.

I'd create such a callAll function and add an editor mapping updating
the list for me.


The callAll function is a one liner:

callAll = path: list: listToAttrs (map (n: nameValue n (callPackage path+n)) list)

Given the example above it can be used in this way:

callAll ./ ["abc" "def"];

Marc Weber



More information about the nix-dev mailing list