Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Don't have an auto directory #3

Closed
infinisil opened this issue Sep 15, 2022 · 5 comments · Fixed by #8
Closed

Don't have an auto directory #3

infinisil opened this issue Sep 15, 2022 · 5 comments · Fixed by #8

Comments

@infinisil
Copy link
Member

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
Copy link

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
Copy link
Contributor

davidak commented Sep 16, 2022

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
Copy link
Member Author

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
Copy link
Contributor

roberth commented Sep 21, 2022

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

  • components/postgresql/package.nix
  • components/postgresql/nixos-module.nix

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

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

  • packages/<name>/called-package.nix for auto-called ones and
  • packages/<name>/package.nix for non-auto-called ones, such as pkgs: pkgs.callPackage ./auto-package { defaultArg1 = .....; }

Specifically this avoids unnecessary abbreviations and nesting.

@roberth
Copy link
Contributor

roberth commented Oct 5, 2022

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.

  • components/p/o/postgresql/package.nix
  • components/p/o/postgresql/config-module.nix (RFC 78)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants