Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8ada044ed469
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a808fe4fcdeb
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on May 22, 2020

  1. Copy the full SHA
    0eec48c View commit details
  2. Revert "nixos-containers: Add support for custom nixpkgs argument"

    The referred changeset broke overlays inside NixOS containers.
    See nixos/tests/containers-nixpkgs-overlays.nix.
    
    This reverts commit aa72037.
    pacien committed May 22, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    globin Robin Gloster
    Copy the full SHA
    8d22d0f View commit details
  3. Merge pull request #88619 from pacien/20.03-revert-containers-pkgs

    [20.03] revert containers pkgs
    adisbladis authored May 22, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    globin Robin Gloster
    Copy the full SHA
    a808fe4 View commit details
Showing with 12 additions and 25 deletions.
  1. +2 −16 nixos/modules/virtualisation/containers.nix
  2. +1 −1 nixos/tests/all-tests.nix
  3. +9 −8 nixos/tests/{containers-custom-pkgs.nix → containers-nixpkgs-overlays.nix}
18 changes: 2 additions & 16 deletions nixos/modules/virtualisation/containers.nix
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -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 {};
Original file line number Diff line number Diff line change
@@ -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"
)
'';
})