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;
7 { # Optional. Allows an extended `lib` to be used instead of the regular Nixpkgs lib.
10 # Feature flags allow you to opt in to unfinished code. These may change some
11 # behavior or disable warnings.
14 # This file itself is rather new, so we accept unknown parameters to be forward
15 # compatible. This is generally not recommended, because typos go undetected.
19 seqIf = cond: if cond then builtins.seq else a: b: b;
20 # If cond, force `a` before returning any attr
21 seqAttrsIf = cond: a: lib.mapAttrs (_: v: seqIf cond a v);
23 eval-config-minimal = import ./eval-config-minimal.nix { inherit lib; };
25 testing-lib = import ./testing/default.nix { inherit lib; };
28 This attribute set appears as lib.nixos in the flake, or can be imported
29 using a binding like `nixosLib = import (nixpkgs + "/nixos/lib") { }`.
32 inherit (seqAttrsIf (!featureFlags?minimalModules) minimalModulesWarning eval-config-minimal)