2020-04-19 13:41:18 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ...} : let
|
|
|
|
|
|
|
|
customPkgs = pkgs // {
|
|
|
|
hello = pkgs.hello.overrideAttrs(old: {
|
|
|
|
name = "custom-hello";
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2020-12-15 19:24:57 +00:00
|
|
|
name = "containers-custom-pkgs";
|
2020-04-19 13:41:18 +00:00
|
|
|
meta = with lib.maintainers; {
|
|
|
|
maintainers = [ adisbladis ];
|
|
|
|
};
|
|
|
|
|
2020-12-15 19:24:57 +00:00
|
|
|
machine = { ... }: {
|
|
|
|
containers.test = {
|
|
|
|
autoStart = true;
|
|
|
|
pkgs = customPkgs;
|
|
|
|
config = {pkgs, config, ... }: {
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.hello
|
|
|
|
];
|
2020-04-19 13:41:18 +00:00
|
|
|
};
|
|
|
|
};
|
2020-12-15 19:24:57 +00:00
|
|
|
};
|
2020-04-19 13:41:18 +00:00
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("default.target")
|
|
|
|
machine.succeed(
|
2020-12-15 19:24:57 +00:00
|
|
|
"test $(nixos-container run test -- readlink -f /run/current-system/sw/bin/hello) = ${customPkgs.hello}/bin/hello"
|
2020-04-19 13:41:18 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
})
|