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
|
2009-05-24 12:57:41 +02:00
|
|
|
if (lib.attrByPath ["_type"] "" b) == "option" then "" else
|
2007-11-10 14:35:50 +01:00
|
|
|
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)
|
2009-05-24 12:57:46 +02:00
|
|
|
(builtins.getAttr x a)
|
2009-05-24 12:57:41 +02:00
|
|
|
(lib.attrByPath [x] null b))
|
2007-11-10 14:35:50 +01:00
|
|
|
(attrNames a)) ""
|
|
|
|
);
|
|
|
|
in
|
|
|
|
checkAttrInclusion "" configuration options
|
|
|
|
|