From c47e89623b168bc4058e10f08bf8ebd71cab366e Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sun, 9 Aug 2015 14:40:01 +0200 Subject: [PATCH] Update option-usages.nix expression to work with newer version of the module system. --- lib/modules.nix | 2 +- nixos/lib/eval-config.nix | 4 +- nixos/maintainers/option-usages.nix | 174 +++++++++++++++++++++------- 3 files changed, 138 insertions(+), 42 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index a40f02dcc3dd..3e4d0547ecc5 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -55,7 +55,7 @@ rec { }; }; - closed = closeModules (modules ++ [ internalModule ]) (specialArgs // { inherit config options; lib = import ./.; }); + closed = closeModules (modules ++ [ internalModule ]) ({ inherit config options; lib = import ./.; } // specialArgs); # Note: the list of modules is reversed to maintain backward # compatibility with the old module system. Not sure if this is diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix index 97cb85a957f6..3e07df6c0860 100644 --- a/nixos/lib/eval-config.nix +++ b/nixos/lib/eval-config.nix @@ -17,6 +17,8 @@ baseModules ? import ../modules/module-list.nix , # !!! See comment about args in lib/modules.nix extraArgs ? {} +, # !!! See comment about args in lib/modules.nix + specialArgs ? {} , modules , # !!! See comment about check in lib/modules.nix check ? true @@ -47,7 +49,7 @@ in rec { inherit prefix check; modules = modules ++ extraModules ++ baseModules ++ [ pkgsModule ]; args = extraArgs; - specialArgs = { modulesPath = ../modules; }; + specialArgs = { modulesPath = ../modules; } // specialArgs; }) config options; # These are the extra arguments passed to every module. In diff --git a/nixos/maintainers/option-usages.nix b/nixos/maintainers/option-usages.nix index 7413b9e18cec..854ecf7eac51 100644 --- a/nixos/maintainers/option-usages.nix +++ b/nixos/maintainers/option-usages.nix @@ -1,59 +1,125 @@ { configuration ? import ../lib/from-env.nix "NIXOS_CONFIG" -# []: display all options -# [