diff options
author | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-09-18 15:10:11 +0000 |
---|---|---|
committer | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-09-18 15:10:11 +0000 |
commit | c6267a8c9d4f69719ffa8117a899081e2746904f (patch) | |
tree | da6e5ae713b0739ab94fd4b2022948d6c0c0f6d8 /pkgs/lib/modules.nix | |
parent | e07f5d2a2cb72d8ba7fbfd4bf7999d6bf3684241 (diff) | |
download | nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar.gz nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar.bz2 nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar.lz nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar.xz nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.tar.zst nixpkgs-c6267a8c9d4f69719ffa8117a899081e2746904f.zip |
Add declarations and definitions to options. This allow you to retrieve
the location of the definition with the defined value. Filter the source location for the documentation. svn path=/nixpkgs/trunk/; revision=17253
Diffstat (limited to 'pkgs/lib/modules.nix')
-rw-r--r-- | pkgs/lib/modules.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix index 10667dc3ade..d9b9d3b54c1 100644 --- a/pkgs/lib/modules.nix +++ b/pkgs/lib/modules.nix @@ -207,6 +207,19 @@ rec { addOptionMakeUp { name = addName name; recurseInto = recurseForOption; } (mergeOptionDecls decls) + // { + declarations = + map (m: { + source = m.key; + value = m.options; + }) (declarationsOf name); + + definitions = + map (m: { + source = m.key; + value = m.config; + }) (definitionsOf name); + } else if all isAttrs values then (recurseInto name modules).options else |