nixpkgs/nixos/tests/containers-custom-pkgs.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
880 B
Nix
Raw Normal View History

2021-02-26 18:03:49 +03:00
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";
2021-02-26 18:03:49 +03:00
meta = {
maintainers = with lib.maintainers; [ adisbladis erikarvstedt ];
};
2022-03-21 02:15:30 +03:00
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";
})