nixpkgs/nixos/modules/installer/tools/nixos-option
Chuck 09ac7cb55f nixos/nixos-option: Show values inside aggregate options uniformly
1. This makes aggregates of submodules (including the very important
"nixos-option users.users.<username>" case) behave the same way as any
other you-need-to-keep-typing-to-get-to-an-option-leaf (eg:
"nixos-option environment").

Before e0780c5:

  $ nixos-option users.users.root
  error: At 'root' in path 'users.users.root': Attribute not found
  An error occurred while looking for attribute names. Are you sure that 'users.users.root' exists?

After e0780c5 but before this change, this query just printed out a raw
thing, which is behavior that belongs in "nix eval", "nix-instantiate
--eval", or "nix repl <<<":

  $ nixos-option users.users.root
  {
    _module = {
      args = { name = "root"; };
      check = true;
    };
    createHome = false;
    cryptHomeLuks = null;
    description = "System administrator";
    ...

After this change:

  $ nixos-option users.users.root
  This attribute set contains:
  createHome
  cryptHomeLuks
  description
  extraGroups
  group
  hashedPassword
  ...

2. For aggregates of other types (not submodules), print out the option
that contains them rather than printing an error message.

Before:

  $ nixos-option environment.shellAliases.l
  error: At 'l' in path 'environment.shellAliases.l': Attribute not found
  An error occurred while looking for attribute names. Are you sure that 'environment.shellAliases.l' exists?

After:

  $ nixos-option environment.shellAliases.l
  Note: showing environment.shellAliases instead of environment.shellAliases.l
  Value:
  {
    l = "ls -alh";
    ll = "ls -l";
    ls = "ls --color=tty";
  }
  ...
2019-12-19 15:00:43 +01:00
..
CMakeLists.txt nixos/nixos-option: Rewrite in a more suitable language 2019-11-04 15:11:44 +01:00
default.nix Add maintainer 2019-11-04 15:11:45 +01:00
libnix-copy-paste.cc Reformat for 4-space indentation 2019-11-04 15:11:44 +01:00
libnix-copy-paste.hh Reformat for 4-space indentation 2019-11-04 15:11:44 +01:00
nixos-option.cc nixos/nixos-option: Show values inside aggregate options uniformly 2019-12-19 15:00:43 +01:00