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:
@@ -54,6 +54,11 @@ let
|
||||
inherit (config.system) nixosVersion nixosCodeName nixosRevision;
|
||||
};
|
||||
|
||||
nixos-typecheck = makeProg {
|
||||
name = "nixos-typecheck";
|
||||
src = ./nixos-typecheck.sh;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@@ -67,10 +72,11 @@ in
|
||||
nixos-generate-config
|
||||
nixos-option
|
||||
nixos-version
|
||||
nixos-typecheck
|
||||
];
|
||||
|
||||
system.build = {
|
||||
inherit nixos-install nixos-generate-config nixos-option nixos-rebuild;
|
||||
inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-typecheck;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user