nixpkgs-suyu/nixos/modules
Maximilian Bosch 76cc15a364
nixos-option: don't abort with shell failures if options are not existant
`nixos-option` basically handles two cases: the given option is either a
valid option defined using `mkOption` or an attribute set which contains
a set of options.

If none of the above cases is valid, `$1` is invalid. Unfortunatley the
script interpreted invalid options as an attribute set which rendered
shell failures when trying to evaluate the arguments.

First of all, `if names=$(attrNames ...)` resulted in `<PRIMOP>` as
`attrNames` simply evaluated `builtins.attrNames $result` which results
in a non-applied function with `$result` being empty. Trying to map over
this string using `nixMap` while applying `escapeQuotes` causes the bash
error as `eval echo "<PRIMOP>"` is invalid syntax.

Explicitly checking if `$result' contains a value (do we have an
attribute set?) and otherwise returning a warning and asking if $option
exists fixes the problem.

Fixes #48060
2018-10-10 13:19:52 +02:00
..
config Merge branch 'master' into staging-next 2018-09-13 10:08:53 +02:00
hardware Merge pull request #42846 from ambrop72/optimus-prime-config-master 2018-10-03 22:56:53 -05:00
i18n/input-method docs: format 2018-09-29 20:51:11 -04:00
installer nixos-option: don't abort with shell failures if options are not existant 2018-10-10 13:19:52 +02:00
misc version.nix: extract revision-fetching function 2018-10-05 11:06:28 -04:00
profiles nixos: Fix eval error for documentation.nixos 2018-09-25 23:39:44 +02:00
programs nixos/bash: Use escapeShellArg for shell aliases 2018-10-06 20:01:27 +00:00
security Merge pull request #47563 from jameysharp/unscripted 2018-10-02 19:21:34 +01:00
services Merge pull request #48080 from Lassulus/gnome-gdm 2018-10-09 23:22:41 +01:00
system Merge pull request #46964 from florianjacob/systemd-assert-value-tostring 2018-10-05 23:00:41 -05:00
tasks networking.hostId: fix cmd in description 2018-09-11 11:29:04 +02:00
testing Add ssh backdoor to VM tests infrastructure. 2018-09-28 10:53:08 +01:00
virtualisation Merge pull request #47917 from arianvp/fix-imperative-containers 2018-10-08 16:55:38 -04:00
module-list.nix Merge pull request #45109 from jfrankenau/module-triggerhappy 2018-10-08 14:42:59 -05:00
rename.nix kubernetes: 1.11.3 -> 1.12.0 2018-09-30 14:49:26 +02:00