nixpkgs-architecture / simple-package-paths

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

Explain what `unit` is #16

Closed infinisil closed 1 year ago

infinisil commented 1 year ago

The current draft uses pkgs/unit/<name>/pkg-fun.nix as the directory structure. We should explain what "unit" is and why that name is fitting.

We decided on this name among other candidates in the last meeting.

On discourse, @blaggacao points out that std's "cell" concept is the same as the "unit" we're talking about here.

Also on Discourse I proposed this general description of a "unit" in nixpkgs:

A collection of standardized files related to the same software component

blaggacao commented 1 year ago

A standardized collection of functionality related to the same software component

( "files" → "functionality")

In the context of nixpkgs, a Collection of (Nix) Packages, the "software component", in a sense that goes actually beyond a "package", is the domain around which related functionality accrues.

See also the quite similar mental model of The 4 Layers of Packaging.

/cc @Ericson2314 re "layers" :wink:

... which begs the question, will you rebrand to @Ericson1234 once the (nix &) nixpkgs architecture is properly layered (in "units of related functionality")? :wink:

Ericson2314 commented 1 year ago

@blaggacao I am not too concerned at this point, because we can "soft launch" the "unit" name in the repo file path (implementation detail, private) before putting it somewhere more public.