I have a command I use to look up package maintainers without manually indexing the meta.maintainers to maintainers/maintainer-list.nix every time (since a lot of the keys are not the same as the GitHub username):
But I’m struggling to come up with a command to do the same for NixOS option maintainers such as these. nixos-option, for example, does not seem to expose the metadata at all.
Update: I’m using flakes for my NixOS configuration, and I don’t have an /etc/nixos/configuration.nix. My NixOS configuration is in a repo.
Wait, but nixos-option documentation does the expected thing? That’s strange if so.
Are you flakin’? I see there’s a comment in nixos/modules/misc/nixpkgs-flake.nix about NIX_PATH not containing nixos-config in the flake case, and I guess if you’re using nixos-option --flake that’ll continue to work. Someone else will have to tell you how to import the NixOS module system when your system is flaked, I’m afraid.
❯ nix eval --expr 'let inherit (import <nixpkgs/nixos> {}) pkgs; inherit (import <nixpkgs/nixos/lib/eval-config.nix> { modules = [{}]; }) config options; in map (maintainer: maintainer.github) (config.meta.maintainers.${pkgs.lib.head options.documentation.declarations} or [])' --impure --raw
error:
… while calling the 'map' builtin
at «string»:1:139:
1| let inherit (import <nixpkgs/nixos> {}) pkgs; inherit (import <nixpkgs/nixos/lib/eval-config.nix> { modules = [{}]; }) config options; in map (maintainer: maintainer.github) (config.meta.maintainers.${pkgs.lib.head options.documentation.declarations} or [])
| ^
… while evaluating the attribute 'pkgs'
at /nix/store/klbzxibpzfh6qqvn78axh0373zl4kkrh-source/nixos/default.nix:19:18:
18| {
19| inherit (eval) pkgs config options;
| ^
20|
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: file 'nixos-config' was not found in the Nix search path (add it using $NIX_PATH or -I)
right, because you are still import <nixpkgs/nixos> {}ing… seemingly to get pkgs which is then only used for pkgs.lib.head which can likely be replaced by builtins.head.
If you really truly need pkgs, then the import statement I provided also provides pkgs and others beyond just config and options.
yet that doesn’t seem to matter for config.meta.maintainers which is where the error message you posted is pointing you. Is it unreasonable to just add back the or [] as suggested?
EDIT: actually I’m just confused. Why are you linking meta.doc when you are having issues with documentation.man.enable?
I don’t know what you mean. I don’t see meta.doc anywhere in this post.
I simply want to know a simple shell command to get the maintainers of the documentation options. It’s imported in documentation.nix, but I can’t find it anywhere in options.documentation in the Nix REPL.