Merge pull request #88619 from pacien/20.03-revert-containers-pkgs

[20.03] revert containers pkgs
This commit is contained in:
adisbladis
2020-05-23 00:11:21 +02:00
committed by GitHub
3 changed files with 12 additions and 25 deletions

View File

@@ -463,15 +463,10 @@ in
A specification of the desired configuration of this
container, as a NixOS module.
'';
type = let
confPkgs = if config.pkgs == null then pkgs else config.pkgs;
in lib.mkOptionType {
type = lib.mkOptionType {
name = "Toplevel NixOS config";
merge = loc: defs: (import (confPkgs.path + "/nixos/lib/eval-config.nix") {
merge = loc: defs: (import ../../lib/eval-config.nix {
inherit system;
pkgs = confPkgs;
baseModules = import (confPkgs.path + "/nixos/modules/module-list.nix");
inherit (confPkgs) lib;
modules =
let
extraConfig = {
@@ -520,15 +515,6 @@ 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;

View File

@@ -51,7 +51,7 @@ in
codimd = handleTest ./codimd.nix {};
consul = handleTest ./consul.nix {};
containers-bridge = handleTest ./containers-bridge.nix {};
containers-custom-pkgs.nix = handleTest ./containers-custom-pkgs.nix {};
containers-nixpkgs-overlays.nix = handleTest ./containers-nixpkgs-overlays.nix {};
containers-ephemeral = handleTest ./containers-ephemeral.nix {};
containers-extra_veth = handleTest ./containers-extra_veth.nix {};
containers-hosts = handleTest ./containers-hosts.nix {};

View File

@@ -1,12 +1,10 @@
# Test for NixOS' container support.
# Test for nixpkgs overlays inside NixOS containers.
import ./make-test-python.nix ({ pkgs, lib, ...} : let
customPkgs = pkgs // {
hello = pkgs.hello.overrideAttrs(old: {
name = "custom-hello";
});
};
customHello = pkgs.hello.overrideAttrs(old: {
name = "custom-hello";
});
in {
name = "containers-hosts";
@@ -22,8 +20,11 @@ in {
containers.simple = {
autoStart = true;
pkgs = customPkgs;
config = {pkgs, config, ... }: {
nixpkgs.overlays = [(self: super: {
hello = customHello;
})];
environment.systemPackages = [
pkgs.hello
];
@@ -36,7 +37,7 @@ in {
start_all()
machine.wait_for_unit("default.target")
machine.succeed(
"test $(nixos-container run simple -- readlink -f /run/current-system/sw/bin/hello) = ${customPkgs.hello}/bin/hello"
"test $(nixos-container run simple -- readlink -f /run/current-system/sw/bin/hello) = ${customHello}/bin/hello"
)
'';
})