1{ system ? builtins.currentSystem,
2 config ? {},
3 pkgs ? import ../.. { inherit system config; }
4}:
5let
6 inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
7 shared =
8 { config, pkgs, ... }:
9 {
10 programs.nix-ld.enable = true;
11 environment.systemPackages = [
12 (pkgs.runCommand "patched-hello" { } ''
13 install -D -m755 ${pkgs.hello}/bin/hello $out/bin/hello
14 patchelf $out/bin/hello --set-interpreter $(cat ${config.programs.nix-ld.package}/nix-support/ldpath)
15 '')
16 ];
17 };
18in
19{
20 nix-ld = makeTest {
21 name = "nix-ld";
22 nodes.machine = shared;
23 testScript = ''
24 start_all()
25 machine.succeed("hello")
26 '';
27 };
28 nix-ld-rs = makeTest {
29 name = "nix-ld-rs";
30 nodes.machine = {
31 imports = [ shared ];
32 programs.nix-ld.package = pkgs.nix-ld-rs;
33 };
34 testScript = ''
35 start_all()
36 machine.succeed("hello")
37 '';
38 };
39}