summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-01-18 23:18:45 +0100
committerDaiderd Jordan <daiderd@gmail.com>2019-01-18 23:18:45 +0100
commita1c56d5492f7f97cc9aa18158033d5ae911bc317 (patch)
tree674d886825f3ff238018139c36b61438c1fb6f81
parent236d9b0c2d6804a44571b6f7a4d0460ffe900f74 (diff)
system-packages: verify libraries are not linked
By default environment.pathsToLink does not include /lib so libraries should not be exposed directly in the system output.
-rw-r--r--tests/system-packages.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/system-packages.nix b/tests/system-packages.nix
index 092e2d3..0a51813 100644
--- a/tests/system-packages.nix
+++ b/tests/system-packages.nix
@@ -1,10 +1,21 @@
{ config, pkgs, ... }:
+let
+ hello = pkgs.runCommand "hello-0.0.0" {} ''
+ mkdir -p $out/bin $out/lib
+ touch $out/bin/hello $out/lib/libhello.dylib
+ '';
+in
+
{
environment.systemPackages = [ pkgs.hello ];
test = ''
echo checking hello binary in /sw/bin >&2
+ test -e ${config.out}/sw/bin/hello
test "$(readlink -f ${config.out}/sw/bin/hello)" = "${pkgs.hello}/bin/hello"
+
+ echo checking for unexpected paths in /sw/bin >&2
+ ! test -e ${config.out}/sw/lib/libhello.dylib
'';
}