Commit dfb6bdf
[RFC 0140] Simple Package Paths (#140)
* RFC 140
Initialized from nixpkgs-architecture/simple-package-paths@01948e0
* Minor improvements
* Minor nits
* Update co-authors and add pre-RFC reviewers
* pkg-fun.nix -> package.nix
* Mid-sized refactor for improved clarity and incorporating feedback
In addition to some more minor changes and incorporating feedback, the
major changes are:
- Restructure the RFC into two separate parts, one to introduce
the convention and one to migrate packages to it when possible
- Remove the restriction that files inside a unit directory can only be
referenced by the corresponding `pkgs.${name}`. It feels very
unnatural to have this restriction and it's hard to reason about it.
Files inside a unit directory still can't reference anything _outside_
the unit directory, which is very similar to Nix's concept of allowed-uris,
which may be used to implement this check in the future.
- Remove the special case of allowing custom arguments. By not having
this one exception, users viewing a unit directory can be sure that
there's no hidden semantics anywhere (overriding arguments) and that the
functions arguments correspond directly to attributes in `pkgs`, no
exceptions that would require looking at `all-packages.nix`.
And it would be weird just to allow this one exception of
`callPackage` with custom arguments, when there's a lot of other
similarly small exceptions we could make, like allowing
`python3Packages.callPackage`.
- Remove the requirement that new packages must use this standard.
Especially with the above exception removed, this standard is now more
strict and less packages satisfy it by default.
A scenario could be that a user adds a new package, initially not
needing custom arguments, so CI requires it to be in `pkgs/unit`, but
then a custom argument is needed, so it must be moved out of there and
added to `all-packages.nix`. But then the custom argument can be removed,
so it _must_ be in `pkgs/unit` again. This sucks.
So let's keep `all-packages.nix` unrestricted, so a package won't have
to be moved back and forth like this.
* Re-add custom argument exception and various minor improvements
* shard distribution stats, cleanup, more uniformity
* Readd accidentally removed definition
* Mention package variants
* Minor moving and formatting
* Changes from feedback in the meeting
* Link to demonstration of cherry-picking without problems
* Link to demonstrates of problematic/non-problematic Git operations
* Names must be unique when lowercased
* Properly close invisible anchor
* Update summary to mention Nixpkgs more explicitly
* Include more arguments and counter-arguments for pkgs/unit alternatives
* Add shepherd team and nicks
* Convert frontmatter to a table
* Fix table rendering
* Minor fixups
Co-Authored-By: Robert Hensing <[email protected]>
* Explain unit and add more alternatives
* unit -> by-name, remove "standard"
And some very minor changes
* Apply suggestions from code review
Remove the barely used term "base directory"
Co-authored-by: Robert Hensing <[email protected]>
---------
Co-authored-by: Robert Hensing <[email protected]>
Co-authored-by: Robert Hensing <[email protected]>1 parent f470655 commit dfb6bdf
1 file changed
+395
-0
lines changed
0 commit comments