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