You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In a common flake there are some custom attributes used, that appear in nix flake show just as "unknown". One of the commonly used custom attributes is lib (used by nixpkgs itself). Also homeConfigurations and homeModules are rather common since home-manager got flake support. And I am sure there are equivalent attributes for nix-darwin.
Describe the solution you'd like
There should be a way to label these. This could be done by adding an extra attribute labelers to the flake schema.
A labeler then is a function that returns either a string or an arbitrary nested set of strings. nix flake show will use each attribute name as a "node" in the tree and increase nesting, while a string value will be used as label. As far as I can tell, this would pretty much match what one sees in the nix flake show --json output.
Whenever nix flake show discovers an unknown attribute foo it will call self.labelers.foo self.foo. The labeler then has to inspect the value and build the aforementioned label tree.
The following show snippet could have been created by the returned nix value below it:
├───homeConfigurations
│ ├───nobbz@enceladeus: Home Manager configuration
│ ├───nobbz@mimas: Home Manager configuration
│ └───nobbz@thetys: Home Manager configuration
Is your feature request related to a problem? Please describe.
In a common flake there are some custom attributes used, that appear in
nix flake show
just as "unknown". One of the commonly used custom attributes islib
(used bynixpkgs
itself). AlsohomeConfigurations
andhomeModules
are rather common sincehome-manager
got flake support. And I am sure there are equivalent attributes fornix-darwin
.Describe the solution you'd like
There should be a way to label these. This could be done by adding an extra attribute
labelers
to the flake schema.A
labeler
then is a function that returns either a string or an arbitrary nested set of strings.nix flake show
will use each attribute name as a "node" in the tree and increase nesting, while a string value will be used as label. As far as I can tell, this would pretty much match what one sees in thenix flake show --json
output.Whenever
nix flake show
discovers an unknown attributefoo
it will callself.labelers.foo self.foo
. The labeler then has to inspect the value and build the aforementioned label tree.The following
show
snippet could have been created by the returned nix value below it:Describe alternatives you've considered
External programs that are required to increase discoverability of custom attributes
The text was updated successfully, but these errors were encountered: