nixpkgs/nixos/modules/installer/tools
Maximilian Bosch e0780c5cff
nixos/nixos-option: fix evaluator to render a full submodule entry
When running e.g. `nixos-option users.users.ma27`, the evaluation breaks
since `ma27` is the attribute name in `attrsOf (submodule {})`, but not
a part of the option tree and therefore breaks with the following
errors:

```
error: At 'ma27' in path 'users.users.ma27': Attribute not found
An error occurred while looking for attribute names. Are you sure that 'users.users.ma27' exists?
```

This happens since the option evaluator expects that either the option
exists or the option is a submodule and the "next" token in the
attribute path points to an option (e.g. `users.users.ma27.createHome`).

This patch checks in the `Attribute not found` condition if the attribute-path
actually exists in the config tree. If that's true, a dummy-attrset is created
which contains `{_type = "__nixos-option-submodule-attr";}`, in that case, the
entire entry of the submodule will be displayed.
2019-12-12 14:27:36 +01:00
..
nixos-build-vms nixos-build-vms: pass --option to nix-build 2019-02-04 10:46:12 +01:00
nixos-option nixos/nixos-option: fix evaluator to render a full submodule entry 2019-12-12 14:27:36 +01:00
get-version-suffix Revert adding .git-revision unconditionally 2016-08-09 14:15:06 +02:00
nix-fallback-paths.nix nix: 2.3 -> 2.3.1 2019-10-10 16:23:33 +02:00
nixos-enter.sh nixos-enter: silent activation script option 2019-08-13 23:48:58 +02:00
nixos-generate-config.pl nixos-generate-config: add useDHCP per interface 2019-09-24 11:44:01 +02:00
nixos-install.sh Revert "Merge #67232: machinectl compliant NixOS installation" 2019-10-07 20:56:59 +02:00
nixos-rebuild.sh nixos-rebuild: add explicit option to enable (remote) sudo 2019-11-07 17:03:12 +01:00
nixos-version.sh Revert "Merge pull request #48122 from zimbatm/pkg-nixos-rebuild" 2018-10-16 20:25:44 +02:00
tools.nix nixos/nixos-option: Rewrite in a more suitable language 2019-11-04 15:11:44 +01:00