mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Add the tool "nixos-typecheck" that can check an option declaration to:
- Enforce that an option declaration has a "defaultText" if and only if the type of the option derives from "package", "packageSet" or "nixpkgsConfig" and if a "default" attribute is defined. - Enforce that the value of the "example" attribute is wrapped with "literalExample" if the type of the option derives from "package", "packageSet" or "nixpkgsConfig". - Warn if a "defaultText" is defined in an option declaration if the type of the option does not derive from "package", "packageSet" or "nixpkgsConfig". - Warn if no "type" is defined in an option declaration.
This commit is contained in:
parent
c483224c82
commit
cad8957eab
24 changed files with 703 additions and 127 deletions
|
@ -48,8 +48,7 @@ let
|
|||
if svc ? function then svc.function
|
||||
else import (toString "${toString ./.}/${if svc ? serviceType then svc.serviceType else svc.serviceName}.nix");
|
||||
config = (evalModules
|
||||
{ modules = [ { options = res.options; config = svc.config or svc; } ];
|
||||
check = false;
|
||||
{ modules = [ { options = res.options; config = svc.config or svc; } ] ++ [ { _module.check = false; } ];
|
||||
}).config;
|
||||
defaults = {
|
||||
extraConfig = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue