Loading lib/deprecated.nix +30 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,36 @@ rec { } ); closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);}); closePropagationSlow = list: (uniqList {inputList = (innerClosePropagation [] list);}); # This is an optimisation of lib.closePropagation which avoids the O(n^2) behavior # Using a list of derivations, it generates the full closure of the propagatedXXXBuildInputs # The ordering / sorting / comparison is done based on the `outPath` # attribute of each derivation. # On some benchmarks, it performs up to 15 times faster than lib.closePropagation. # See https://github.com/NixOS/nixpkgs/pull/194391 for details. closePropagationFast = list: builtins.map (x: x.val) (builtins.genericClosure { startSet = builtins.map (x: { key = x.outPath; val = x; }) (builtins.filter (x: x != null) list); operator = item: if !builtins.isAttrs item.val then [ ] else builtins.concatMap (x: if x != null then [{ key = x.outPath; val = x; }] else [ ]) ((item.val.propagatedBuildInputs or [ ]) ++ (item.val.propagatedNativeBuildInputs or [ ])); }); closePropagation = if builtins ? genericClosure then closePropagationFast else closePropagationSlow; # calls a function (f attr value ) for each record item. returns a list mapAttrsFlatten = f: r: map (attr: f attr r.${attr}) (attrNames r); Loading lib/generators.nix +1 −1 Original line number Diff line number Diff line Loading @@ -378,7 +378,7 @@ rec { attr = let attrFilter = name: value: name != "_module" && value != null; in ind: x: libStr.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList (name: value: lib.optional (attrFilter name value) [ (name: value: lib.optionals (attrFilter name value) [ (key "\t${ind}" name) (expr "\t${ind}" value) ]) x)); Loading nixos/doc/manual/administration/declarative-containers.section.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; }; }; ``` Loading nixos/doc/manual/configuration/config-file.section.md +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ Packages pkgs.emacs ]; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; ``` The latter option definition changes the default PostgreSQL package Loading nixos/doc/manual/from_md/administration/declarative-containers.section.xml +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; }; }; </programlisting> Loading Loading
lib/deprecated.nix +30 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,36 @@ rec { } ); closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);}); closePropagationSlow = list: (uniqList {inputList = (innerClosePropagation [] list);}); # This is an optimisation of lib.closePropagation which avoids the O(n^2) behavior # Using a list of derivations, it generates the full closure of the propagatedXXXBuildInputs # The ordering / sorting / comparison is done based on the `outPath` # attribute of each derivation. # On some benchmarks, it performs up to 15 times faster than lib.closePropagation. # See https://github.com/NixOS/nixpkgs/pull/194391 for details. closePropagationFast = list: builtins.map (x: x.val) (builtins.genericClosure { startSet = builtins.map (x: { key = x.outPath; val = x; }) (builtins.filter (x: x != null) list); operator = item: if !builtins.isAttrs item.val then [ ] else builtins.concatMap (x: if x != null then [{ key = x.outPath; val = x; }] else [ ]) ((item.val.propagatedBuildInputs or [ ]) ++ (item.val.propagatedNativeBuildInputs or [ ])); }); closePropagation = if builtins ? genericClosure then closePropagationFast else closePropagationSlow; # calls a function (f attr value ) for each record item. returns a list mapAttrsFlatten = f: r: map (attr: f attr r.${attr}) (attrNames r); Loading
lib/generators.nix +1 −1 Original line number Diff line number Diff line Loading @@ -378,7 +378,7 @@ rec { attr = let attrFilter = name: value: name != "_module" && value != null; in ind: x: libStr.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList (name: value: lib.optional (attrFilter name value) [ (name: value: lib.optionals (attrFilter name value) [ (key "\t${ind}" name) (expr "\t${ind}" value) ]) x)); Loading
nixos/doc/manual/administration/declarative-containers.section.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; }; }; ``` Loading
nixos/doc/manual/configuration/config-file.section.md +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ Packages pkgs.emacs ]; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; ``` The latter option definition changes the default PostgreSQL package Loading
nixos/doc/manual/from_md/administration/declarative-containers.section.xml +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ containers.database = { config = { config, pkgs, ... }: { services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql_10; services.postgresql.package = pkgs.postgresql_14; }; }; </programlisting> Loading