Merge pull request #62046 from roberth/pkgs-nixos-expose-all-config

pkgs.nixos: Expose configuration directly
This commit is contained in:
Linus Heckemann 2019-09-01 12:25:39 +02:00 committed by GitHub
commit d9db65ce4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23932,6 +23932,8 @@ in
initialRamdisk. initialRamdisk.
The result can be extended in the modules by defining The result can be extended in the modules by defining
extra attributes in system.build. extra attributes in system.build.
Alternatively, you may use the result's config and
options attributes to query any option.
Example: Example:
@ -23969,10 +23971,13 @@ in
Note that you will need to have called Nixpkgs with the system Note that you will need to have called Nixpkgs with the system
parameter set to the right value for your deployment target. parameter set to the right value for your deployment target.
*/ */
nixos = configuration: nixos =
(import (pkgs.path + "/nixos/lib/eval-config.nix") { configuration:
let
c = import (pkgs.path + "/nixos/lib/eval-config.nix") {
inherit (pkgs.stdenv.hostPlatform) system; inherit (pkgs.stdenv.hostPlatform) system;
modules = [( modules =
[(
{ lib, ... }: { { lib, ... }: {
config.nixpkgs.pkgs = lib.mkDefault pkgs; config.nixpkgs.pkgs = lib.mkDefault pkgs;
} }
@ -23981,7 +23986,9 @@ in
then configuration then configuration
else [configuration] else [configuration]
); );
}).config.system.build; };
in
c.config.system.build // c;
/* /*