summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-01-15 18:25:16 +0100
committeraszlig <aszlig@redmoonstudios.org>2016-01-16 01:13:02 +0100
commitc4de45b7ca1c129fdf48f713be8aade1b5ab6cc1 (patch)
tree6bc2a1f68c48e6a43f341de2977230cce4275502 /nixos
parent26f221d6b62b24d48f79f22e7f12bb6ff10580da (diff)
downloadnixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar.gz
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar.bz2
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar.lz
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar.xz
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.tar.zst
nixlib-c4de45b7ca1c129fdf48f713be8aade1b5ab6cc1.zip
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/quake3.nix9
1 files changed, 9 insertions, 0 deletions
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 ];
         };