From c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 15 Jan 2016 18:25:16 +0100 Subject: nixos/tests/quake3: Fix eval due to unfree license Regression introduced by 6b447a3c9bbee41389052d6fa9e08a53d8447656. In this commit the Quake 3 demo data now have a meta attribute which specifies the license as unfreeRedistributable. While I haven't found anything official about that on the web, let's just allow it to be used in the test because first of all, we have been using it for a long time (since 2009, introduced in 497760b) and second, because it will be quite some effort to rewrite the test with something like OpenArena (particularily because we need coverage data and need to use the ioquake3 version plus OpenArena-specific patches). Tested evaluation on my local system, but the VM test still fails. Signed-off-by: aszlig --- nixos/tests/quake3.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/tests/quake3.nix b/nixos/tests/quake3.nix index d42f7471c832..81a79b0b3e6d 100644 --- a/nixos/tests/quake3.nix +++ b/nixos/tests/quake3.nix @@ -10,6 +10,13 @@ let }); }; + # Only allow the demo data to be used (only if it's unfreeRedistributable). + unfreePredicate = pkg: with pkgs.lib; let + allowDrvPredicates = [ "quake3-demo" "quake3-pointrelease" ]; + allowLicenses = [ pkgs.lib.licenses.unfreeRedistributable ]; + in any (flip hasPrefix pkg.name) allowDrvPredicates && + elem (pkg.meta.license or null) allowLicenses; + in rec { @@ -28,6 +35,7 @@ rec { hardware.opengl.driSupport = true; environment.systemPackages = [ pkgs.quake3demo ]; nixpkgs.config.packageOverrides = overrides; + nixpkgs.config.allowUnfreePredicate = unfreePredicate; }; nodes = @@ -41,6 +49,7 @@ rec { "'+map q3dm7' '+addbot grunt' '+addbot daemia' 2> /tmp/log"; }; nixpkgs.config.packageOverrides = overrides; + nixpkgs.config.allowUnfreePredicate = unfreePredicate; networking.firewall.allowedUDPPorts = [ 27960 ]; }; -- cgit 1.4.1