at 23.05-pre 607 B view raw
1import ./make-test-python.nix ({ lib, pkgs, ...} : 2{ 3 name = "nix-ld"; 4 nodes.machine = { pkgs, ... }: { 5 programs.nix-ld.enable = true; 6 environment.systemPackages = [ 7 (pkgs.runCommand "patched-hello" {} '' 8 install -D -m755 ${pkgs.hello}/bin/hello $out/bin/hello 9 patchelf $out/bin/hello --set-interpreter $(cat ${pkgs.nix-ld}/nix-support/ldpath) 10 '') 11 ]; 12 }; 13 testScript = '' 14 start_all() 15 path = "${pkgs.stdenv.cc}/nix-support/dynamic-linker" 16 with open(path) as f: 17 real_ld = f.read().strip() 18 machine.succeed(f"NIX_LD={real_ld} hello") 19 ''; 20})