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