diff options
author | John Ericson <Ericson2314@yahoo.com> | 2017-09-19 10:52:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 10:52:15 -0400 |
commit | bc9f47199762a38555b38999060534790b96d364 (patch) | |
tree | da84142caae7fc6d989022c1e2c9b284d18254c0 /lib/types.nix | |
parent | 2439a83072d3c2dbbfa69f5937893dd8d1ac73b7 (diff) | |
parent | 152c63c9ff82276e225ac4a4fa71c791d33e443d (diff) | |
download | nixlib-bc9f47199762a38555b38999060534790b96d364.tar nixlib-bc9f47199762a38555b38999060534790b96d364.tar.gz nixlib-bc9f47199762a38555b38999060534790b96d364.tar.bz2 nixlib-bc9f47199762a38555b38999060534790b96d364.tar.lz nixlib-bc9f47199762a38555b38999060534790b96d364.tar.xz nixlib-bc9f47199762a38555b38999060534790b96d364.tar.zst nixlib-bc9f47199762a38555b38999060534790b96d364.zip |
Merge pull request #27797 from grahamc/fixed-lib
Convert libs to a fixed-point
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/types.nix b/lib/types.nix index a7dcd3f1e1c7..62c6a978af90 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1,15 +1,16 @@ # Definitions related to run-time type checking. Used in particular # to type-check NixOS configurations. - -with import ./lists.nix; -with import ./attrsets.nix; -with import ./options.nix; -with import ./trivial.nix; -with import ./strings.nix; -let inherit (import ./modules.nix) mergeDefinitions filterOverrides; in - +{ lib }: +with lib.lists; +with lib.attrsets; +with lib.options; +with lib.trivial; +with lib.strings; +let + + inherit (lib.modules) mergeDefinitions filterOverrides; + outer_types = rec { - isType = type: x: (x._type or "") == type; setType = typeName: value: value // { @@ -95,7 +96,6 @@ rec { # When adding new types don't forget to document them in # nixos/doc/manual/development/option-types.xml! types = rec { - unspecified = mkOptionType { name = "unspecified"; }; @@ -291,7 +291,7 @@ rec { submodule = opts: let opts' = toList opts; - inherit (import ./modules.nix) evalModules; + inherit (lib.modules) evalModules; in mkOptionType rec { name = "submodule"; @@ -395,5 +395,6 @@ rec { addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; }; }; +}; -} +in outer_types // outer_types.types |