Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readdir primop #235

Closed
wants to merge 2 commits into from
Closed

Add readdir primop #235

wants to merge 2 commits into from

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Apr 1, 2014

This is useful for things like nix-make, and may make nixpkgs's organization cleaner

This is useful for things like nix-make, and may make nixpkgs's organization cleaner
@edolstra
Copy link
Member

edolstra commented Apr 1, 2014

It should be named readDirectory or readDir. Also, it should return an attribute set instead of a list. The value of the attributes could include the type of the file (see filterSource).

Also, I don't want to merge this until the use case is more concrete (how "may" it make Nixpkgs organization cleaner?).

@shlevy
Copy link
Member Author

shlevy commented Apr 7, 2014

The main use case I envisioned was for nix-make, similar to how you use wildcard in the nix makefiles. Basically defining a program or library as being composed of all of the c files in the current directory and having individual derivations generated for each and one for linking.

The nixpkgs organization thing was mostly about possibly getting rid of most of all-packages.nix, if we came up with a nice naming scheme for package directories, versioned expressions, etc. then we'd only need a list of overrides when the default callPackage foo {} fails.

@shlevy
Copy link
Member Author

shlevy commented Jun 10, 2014

@edolstra Does my explanation help?

@tailhook
Copy link
Contributor

+1 on this feature by itself. Also hope this will make enumeration of packages in all-packages.nix obsolete.

edolstra added a commit to NixOS/nixpkgs that referenced this pull request Jul 22, 2014
There are zillions of lines of the form

  foo = callPackage ../bla/foo { };

in all-packages.nix. To get rid of this verbosity, you can now list
such packages in pkgs/auto-packages.nix. This is just a list of
package file names, e.g.

  development/libraries/libogg
  development/libraries/libvorbis
  tools/archivers/gnutar

If the package needs non-default function arguments, or if its
intended attribute name is different from its file name, then you
cannot put it in auto-packages.nix and instead need to specify it in
all-packages.nix.

If Nix had a glob function (NixOS/nix#235), we
could even get rid of auto-packages.nix and have package expressions
be discovered automatically. However, that might not be desirable
because of the need to traverse the file system to find packages we
may not even use.
@shlevy shlevy closed this Aug 26, 2014
@shlevy shlevy mentioned this pull request Oct 1, 2014
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
…ser-0.17.0

chore(deps): bump myst-parser from 0.16.1 to 0.17.0
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
these should really wait for networks to come up, otherwise they can fail.

fixes NixOS#235

Change-Id: I08989e8bdb0de280df74660ac43983de5c34fa9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants