1{ pkgs, lib, ... }:
2let
3
4 customPkgs = pkgs.appendOverlays [
5 (self: super: {
6 hello = super.hello.overrideAttrs (old: {
7 name = "custom-hello";
8 });
9 })
10 ];
11
12in
13{
14 name = "containers-custom-pkgs";
15 meta = {
16 maintainers = with lib.maintainers; [ erikarvstedt ];
17 };
18
19 nodes.machine =
20 { config, ... }:
21 {
22 assertions =
23 let
24 helloName = (builtins.head config.containers.test.config.system.extraDependencies).name;
25 in
26 [
27 {
28 assertion = helloName == "custom-hello";
29 message = "Unexpected value: ${helloName}";
30 }
31 ];
32
33 containers.test = {
34 autoStart = true;
35 config =
36 { pkgs, config, ... }:
37 {
38 nixpkgs.pkgs = customPkgs;
39 system.extraDependencies = [ pkgs.hello ];
40 };
41 };
42 };
43
44 # This test only consists of evaluating the test machine
45 testScript = "pass";
46}