at master 1.3 kB view raw
1let 2 # The warning is in a top-level let binding so it is only printed once. 3 minimalModulesWarning = warn "lib.nixos.evalModules is experimental and subject to change. See nixos/lib/default.nix" null; 4 inherit (nonExtendedLib) warn; 5 nonExtendedLib = import ../../lib; 6in 7{ 8 # Optional. Allows an extended `lib` to be used instead of the regular Nixpkgs lib. 9 lib ? nonExtendedLib, 10 11 # Feature flags allow you to opt in to unfinished code. These may change some 12 # behavior or disable warnings. 13 featureFlags ? { }, 14 15 # This file itself is rather new, so we accept unknown parameters to be forward 16 # compatible. This is generally not recommended, because typos go undetected. 17 ... 18}: 19let 20 seqIf = cond: if cond then builtins.seq else a: b: b; 21 # If cond, force `a` before returning any attr 22 seqAttrsIf = cond: a: lib.mapAttrs (_: v: seqIf cond a v); 23 24 eval-config-minimal = import ./eval-config-minimal.nix { inherit lib; }; 25 26 testing-lib = import ./testing/default.nix { inherit lib; }; 27in 28/* 29 This attribute set appears as lib.nixos in the flake, or can be imported 30 using a binding like `nixosLib = import (nixpkgs + "/nixos/lib") { }`. 31*/ 32{ 33 inherit (seqAttrsIf (!featureFlags ? minimalModules) minimalModulesWarning eval-config-minimal) 34 evalModules 35 ; 36 37 inherit (testing-lib) 38 evalTest 39 runTest 40 ; 41 42}