2007-09-25 21:03:07 +02:00
|
|
|
#
|
|
|
|
# Checks that all set options are described.
|
|
|
|
#
|
|
|
|
options: configuration:
|
|
|
|
with builtins;
|
2007-11-10 14:35:50 +01:00
|
|
|
let lib=(import ../../lib); in
|
|
|
|
with lib;
|
2007-09-25 21:03:07 +02:00
|
|
|
|
2007-11-10 14:35:50 +01:00
|
|
|
let
|
2007-09-25 21:03:07 +02:00
|
|
|
findInList = p: list: default:
|
2007-11-10 14:35:50 +01:00
|
|
|
if (list == []) then default else
|
|
|
|
if (p (head list)) then (head list) else
|
|
|
|
findInList p (tail list) default;
|
2007-09-25 21:03:07 +02:00
|
|
|
|
2007-11-10 14:35:50 +01:00
|
|
|
|
|
|
|
checkAttrInclusion = s: a: b:
|
|
|
|
(
|
|
|
|
if (! isAttrs b) then s else
|
|
|
|
if (lib.getAttr ["_type"] "" b) == "option" then "" else
|
|
|
|
findInList (x : x != "")
|
2008-03-25 00:47:40 +01:00
|
|
|
( map (x: if (x == "servicesProposal") # this attr will be checked at another place ( -> upstart-jobs/default.nix )
|
|
|
|
then ""
|
|
|
|
else checkAttrInclusion
|
2007-11-10 14:35:50 +01:00
|
|
|
(s + "." + x)
|
|
|
|
(__getAttr x a)
|
|
|
|
(lib.getAttr [x] null b))
|
|
|
|
(attrNames a)) ""
|
|
|
|
);
|
|
|
|
in
|
|
|
|
checkAttrInclusion "" configuration options
|
|
|
|
|