+22
-142
lib/modules.nix
+22
-142
lib/modules.nix
···············-message = "You can't use ssh-agent and GnuPG agent with SSH support enabled at the same time!";-example = "Enabling both \${options.services.foo.enable} and \${options.services.bar.enable} is not possible.";···if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then·········apply = x: throw "The option `${showOption optionName}' can no longer be used since it's been removed. ${replacementInstructions}";The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it.···-message = "The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly.";+"The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly."···-message = "The option `${showOption from}' defined in ${showFiles fromOpt.files} has been renamed to `${showOption to}'.";+"The option `${showOption from}' defined in ${showFiles fromOpt.files} has been renamed to `${showOption to}'.";
+1
-1
lib/options.nix
+1
-1
lib/options.nix
···-[ docOption ] ++ optionals (docOption.visible && ! docOption.internal) subOptions) (collect isOption options);
+1
-1
lib/tests/misc.nix
+1
-1
lib/tests/misc.nix
···
+21
-57
lib/tests/modules.sh
+21
-57
lib/tests/modules.sh
······-checkConfigCodeOutErr 0 '{ }' 'warning: \[test\] Warning message' config ./assertions/warning.nix-checkConfigError 'Failed checks:\n- \[test1\] Assertion 1 failed\n- \[test2\] Assertion 2 failed' config ./assertions/multi.nix-checkConfigError 'trace: warning: \[test3\] Warning 3 failed\ntrace: warning: \[test4\] Warning 4 failed' config ./assertions/multi.nix-# Submodules should be able to trigger assertions and display the submodule prefix in their error-checkConfigError 'Failed checks:\n- \[foo/test\] Assertion failed' config.foo ./assertions/submodule.nix-checkConfigError 'Failed checks:\n- \[foo.bar/test\] Assertion failed' config.foo.bar ./assertions/submodule-attrsOf.nix-checkConfigError 'Failed checks:\n- \[foo.bar.baz/test\] Assertion failed' config.foo.bar.baz ./assertions/submodule-attrsOf-attrsOf.nix-checkConfigError 'Failed checks:\n- Assertion failed' config ./assertions/underscore-attributes.nix
-8
lib/tests/modules/assertions/condition-true.nix
-8
lib/tests/modules/assertions/condition-true.nix
-9
lib/tests/modules/assertions/enable-false.nix
-9
lib/tests/modules/assertions/enable-false.nix
-23
lib/tests/modules/assertions/multi.nix
-23
lib/tests/modules/assertions/multi.nix
···
-6
lib/tests/modules/assertions/simple.nix
-6
lib/tests/modules/assertions/simple.nix
-13
lib/tests/modules/assertions/submodule-attrsOf-attrsOf.nix
-13
lib/tests/modules/assertions/submodule-attrsOf-attrsOf.nix
-13
lib/tests/modules/assertions/submodule-attrsOf.nix
-13
lib/tests/modules/assertions/submodule-attrsOf.nix
-13
lib/tests/modules/assertions/submodule.nix
-13
lib/tests/modules/assertions/submodule.nix
-8
lib/tests/modules/assertions/underscore-attributes.nix
-8
lib/tests/modules/assertions/underscore-attributes.nix
-9
lib/tests/modules/assertions/warning.nix
-9
lib/tests/modules/assertions/warning.nix
+38
-121
nixos/doc/manual/development/assertions.xml
+38
-121
nixos/doc/manual/development/assertions.xml
···+<link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix">
+1
-14
nixos/modules/misc/assertions.nix
+1
-14
nixos/modules/misc/assertions.nix
······
+9
-1
nixos/modules/system/activation/top-level.nix
+9
-1
nixos/modules/system/activation/top-level.nix
···perl = "${pkgs.perl}/bin/perl " + (concatMapStringsSep " " (lib: "-I${lib}/${pkgs.perl.libPrefix}") (with pkgs.perlPackages; [ FileSlurp NetDBus XMLParser XMLTwig ]));+then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"