Change:
Describe the bug Since the introduction of the option in on master and for release-20.03, overlays defined in containers with are no longer working. To Reproduce Execute this test: Expected behavior Overlays should work inside the containers. Notify maintainers (author of the change) Metadata Please run and paste the result. Maintainer information:
[x] Done. [ ] The option seems useful and should be kept on master for the next release, but it needs to be fixed to work with overlays.
It appears 20.09 is affected by this. While trying to upgrade to 20.09 my containers that use personal overlays fail to build. Looking at the git history for tag 20.09, I see in the history, but not the revert commit , and commit logs for does not include a fix for this bug.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:

Discussion:
{ config, options, name, ... }: { options = { config = mkOption { description = '' A specification of the desired configuration of this container, as a NixOS module. ''; <del> type = let confPkgs = if config.pkgs == null then pkgs else config.pkgs; in lib.mkOptionType { </del> <ins> type = lib.mkOptionType { </ins> name = "Toplevel NixOS config"; <del> merge = loc: defs: (import (confPkgs.path + "/nixos/lib/eval-config.nix") { </del> <ins> merge = loc: defs: (import "${toString config.nixpkgs}/nixos/lib/eval-config.nix" { </ins> inherit system; <del> pkgs = confPkgs; baseModules = import (confPkgs.path + "/nixos/modules/module-list.nix"); inherit (confPkgs) lib; </del> modules = let extraConfig = {

''; }; <del> pkgs = mkOption { type = types.nullOr types.attrs; default = null; example = literalExample "pkgs"; </del> <ins> nixpkgs = mkOption { type = types.path; default = pkgs.path; defaultText = "pkgs.path"; </ins> description = '' <del> Customise which nixpkgs to use for this container. </del> <ins> A path to the nixpkgs that provide the modules, pkgs and lib for evaluating the container. To only change the <literal>pkgs</literal> argument used inside the container modules, set the <literal>nixpkgs.*</literal> options in the container <option>config</option>. Setting <literal>config.nixpkgs.pkgs = pkgs</literal> speeds up the container evaluation by reusing the system pkgs, but the <literal>nixpkgs.config</literal> option in the container config is ignored in this case. </ins> ''; };

''; }; <ins> # Removed option. See `checkAssertion` below for the accompanying error message. pkgs = mkOption { visible = false; }; </ins> } // networkOptions; <del> config = mkMerge [ (mkIf options.config.isDefined { path = config.config.system.build.toplevel; }) ]; </del> <ins> config = let # Throw an error when removed option `pkgs` is used. # Because this is a submodule we cannot use `mkRemovedOptionModule` or option `assertions`. optionPath = "containers.${name}.pkgs"; files = showFiles options.pkgs.files; checkAssertion = if options.pkgs.isDefined then throw '' The option definition `${optionPath}' in ${files} no longer has any effect; please remove it. Alternatively, you can use the following options: - containers.${name}.nixpkgs This sets the nixpkgs (and thereby the modules, pkgs and lib) that are used for evaluating the container. - containers.${name}.config.nixpkgs.pkgs This only sets the `pkgs` argument used inside the container modules. '' else null; in { path = builtins.seq checkAssertion mkIf options.config.isDefined config.config.system.build.toplevel; }; </ins> })); default = {};

<del> # Test for NixOS' container support. </del> import ./make-test-python.nix ({ pkgs, lib, ...} : let <del> customPkgs = pkgs // { hello = pkgs.hello.overrideAttrs(old: { name = "custom-hello"; </del> <ins> customPkgs = pkgs.appendOverlays [ (self: super: { hello = super.hello.overrideAttrs (old: { name = "custom-hello"; </ins> }); <del> }; </del> <ins> }) ]; </ins> in { <del> name = "containers-hosts"; </del> <ins> name = "containers-custom-pkgs"; </ins> meta = with lib.maintainers; { <del> maintainers = [ adisbladis ]; </del> <ins> maintainers = [ adisbladis earvstedt ]; </ins> }; <del> machine = { ... }: { virtualisation.memorySize = 256; virtualisation.vlans = []; </del> <ins> machine = { config, ... }: { assertions = let helloName = (builtins.head config.containers.test.config.system.extraDependencies).name; in [ { assertion = helloName == "custom-hello"; message = "Unexpected value: ${helloName}"; } ]; </ins> <del> containers.simple = { autoStart = true; pkgs = customPkgs; config = {pkgs, config, ... }: { environment.systemPackages = [ pkgs.hello ]; }; </del> <ins> containers.test = { autoStart = true; config = { pkgs, config, ... }: { nixpkgs.pkgs = customPkgs; system.extraDependencies = [ pkgs.hello ]; </ins> }; }; <ins> }; </ins> <del> testScript = '' 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" ) ''; </del> <ins> # This test only consists of evaluating the test machine testScript = ""; </ins> })