at 23.11-beta 905 B view raw
1{ pkgs, ... }: 2 3let 4 patchedPkgs = pkgs.extend (new: old: { 5 lib = old.lib.extend (self: super: { 6 sorry_dave = "sorry dave"; 7 }); 8 }); 9 10 testBody = { 11 name = "demo lib overlay"; 12 13 nodes = { 14 machine = { lib, ... }: { 15 environment.etc."got-lib-overlay".text = lib.sorry_dave; 16 }; 17 }; 18 19 # We don't need to run an actual test. Instead we build the `machine` configuration 20 # and call it a day, because that already proves that `lib` is wired up correctly. 21 # See the attrset returned at the bottom of this file. 22 testScript = ""; 23 }; 24 25 inherit (patchedPkgs.testers) nixosTest runNixOSTest; 26 evaluationNixosTest = nixosTest testBody; 27 evaluationRunNixOSTest = runNixOSTest testBody; 28in { 29 nixosTest = evaluationNixosTest.driver.nodes.machine.system.build.toplevel; 30 runNixOSTest = evaluationRunNixOSTest.driver.nodes.machine.system.build.toplevel; 31}