mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos-containers: Add support for custom nixpkgs argument
This commit is contained in:
parent
53c14c4e65
commit
ab37d7e7ea
3 changed files with 59 additions and 2 deletions
|
@ -463,10 +463,15 @@ in
|
|||
A specification of the desired configuration of this
|
||||
container, as a NixOS module.
|
||||
'';
|
||||
type = lib.mkOptionType {
|
||||
type = let
|
||||
confPkgs = if config.pkgs == null then pkgs else config.pkgs;
|
||||
in lib.mkOptionType {
|
||||
name = "Toplevel NixOS config";
|
||||
merge = loc: defs: (import ../../lib/eval-config.nix {
|
||||
merge = loc: defs: (import (confPkgs.path + "/nixos/lib/eval-config.nix") {
|
||||
inherit system;
|
||||
pkgs = confPkgs;
|
||||
baseModules = import (confPkgs.path + "/nixos/modules/module-list.nix");
|
||||
inherit (confPkgs) lib;
|
||||
modules =
|
||||
let
|
||||
extraConfig = {
|
||||
|
@ -515,6 +520,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
pkgs = mkOption {
|
||||
type = types.nullOr types.attrs;
|
||||
default = null;
|
||||
example = literalExample "pkgs";
|
||||
description = ''
|
||||
Customise which nixpkgs to use for this container.
|
||||
'';
|
||||
};
|
||||
|
||||
ephemeral = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue