depot/third_party/nixpkgs/nixos/tests/containers-custom-pkgs.nix
Default email ca5ab3a501 Project import generated by Copybara.
GitOrigin-RevId: 4a01ca36d6bfc133bc617e661916a81327c9bbc8
2022-07-14 08:49:19 -04:00

34 lines
880 B
Nix

import ./make-test-python.nix ({ pkgs, lib, ... }: let
customPkgs = pkgs.appendOverlays [ (self: super: {
hello = super.hello.overrideAttrs (old: {
name = "custom-hello";
});
}) ];
in {
name = "containers-custom-pkgs";
meta = {
maintainers = with lib.maintainers; [ adisbladis erikarvstedt ];
};
nodes.machine = { config, ... }: {
assertions = let
helloName = (builtins.head config.containers.test.config.system.extraDependencies).name;
in [ {
assertion = helloName == "custom-hello";
message = "Unexpected value: ${helloName}";
} ];
containers.test = {
autoStart = true;
config = { pkgs, config, ... }: {
nixpkgs.pkgs = customPkgs;
system.extraDependencies = [ pkgs.hello ];
};
};
};
# This test only consists of evaluating the test machine
testScript = "pass";
})