depot/third_party/nixpkgs/nixos/tests/nixos-test-driver/lib-extend.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

31 lines
905 B
Nix

{ pkgs, ... }:
let
patchedPkgs = pkgs.extend (new: old: {
lib = old.lib.extend (self: super: {
sorry_dave = "sorry dave";
});
});
testBody = {
name = "demo lib overlay";
nodes = {
machine = { lib, ... }: {
environment.etc."got-lib-overlay".text = lib.sorry_dave;
};
};
# We don't need to run an actual test. Instead we build the `machine` configuration
# and call it a day, because that already proves that `lib` is wired up correctly.
# See the attrset returned at the bottom of this file.
testScript = "";
};
inherit (patchedPkgs.testers) nixosTest runNixOSTest;
evaluationNixosTest = nixosTest testBody;
evaluationRunNixOSTest = runNixOSTest testBody;
in {
nixosTest = evaluationNixosTest.driver.nodes.machine.system.build.toplevel;
runNixOSTest = evaluationRunNixOSTest.driver.nodes.machine.system.build.toplevel;
}