nixpkgs-architecture / simple-package-paths

Nix RFC draft for auto-calling packages in nixpkgs
18 stars 1 forks source link

Don't have an `auto` directory #3

Closed infinisil closed 1 year ago

infinisil commented 2 years ago

Idea: Instead of having pkgs/auto be the auto-called directory, have it be pkgs directly. All the bits that can't be auto-called should be put into new top-level directories. This idea was brought to attention by @davidak on Matrix

Moredread commented 2 years ago

To expand on this, for packages that only have the default.nix file, why not skip putting it in it's own, otherwise empty directory. I.e. pkgs/applications/editors/ed/default.nix would become pkgs/ed.nix

davidak commented 2 years ago

To expand on this, for packages that only have the default.nix file, why not skip putting it in it's own, otherwise empty directory. I.e. pkgs/applications/editors/ed/default.nix would become pkgs/ed.nix

for consistency, it would be good if every package has a directory. that also makes it easy to add more files to the package

and if i understand the technical proposal correct, the directories are what is "auto-called", so they are needed

infinisil commented 2 years ago

It could be done technically (just needs a slight adjustment to callPackage, could even be limited to the auto-calling only), but I agree that always having a directory is better for consistency. (Let's keep this discussion to a separate issue though, it's not the same as whether auto is needed).

roberth commented 1 year ago

I think a good long term ambition is to move to a <component>/<file-type>.nix

See https://github.com/nixpkgs-architecture/issues/issues/5#issuecomment-1228656788

If that's too radical for now, we can reduce that to

Specifically this avoids unnecessary abbreviations and nesting.

roberth commented 1 year ago

Even if we don't decide to move NixOS modules into components/postgresql/nixos-module.nix style locations, preparing the structure for RFC 78 would be fantastic, considering how disruptive mass-moves are.