about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/nix-ld.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/nix-ld.nix')
-rw-r--r--nixpkgs/nixos/tests/nix-ld.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/nix-ld.nix b/nixpkgs/nixos/tests/nix-ld.nix
new file mode 100644
index 000000000000..8733f5b0c397
--- /dev/null
+++ b/nixpkgs/nixos/tests/nix-ld.nix
@@ -0,0 +1,17 @@
+import ./make-test-python.nix ({ lib, pkgs, ...} :
+{
+  name = "nix-ld";
+  nodes.machine = { pkgs, ... }: {
+    programs.nix-ld.enable = true;
+    environment.systemPackages = [
+      (pkgs.runCommand "patched-hello" {} ''
+        install -D -m755 ${pkgs.hello}/bin/hello $out/bin/hello
+        patchelf $out/bin/hello --set-interpreter $(cat ${pkgs.nix-ld}/nix-support/ldpath)
+      '')
+    ];
+  };
+  testScript = ''
+    start_all()
+    machine.succeed("hello")
+ '';
+})