From 745167880820303fc774776136899378768ddfe7 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 11 Dec 2015 10:23:58 +0100 Subject: profiles/tests: Fix evaluation for real. This time I've gone through the hoops of almost running out of memory, because evaluating the channel expression now eats lots of RAM. Meaning: I've now actually tested it on my system without just throwing it at the Hydra box which has lots of RAM... unlike my local machine :-( Signed-off-by: aszlig --- modules/profiles/tests.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/profiles') diff --git a/modules/profiles/tests.nix b/modules/profiles/tests.nix index 7a7ff822..f258e67f 100644 --- a/modules/profiles/tests.nix +++ b/modules/profiles/tests.nix @@ -7,6 +7,8 @@ let mkTest = attrs: if attrs.check then attrs.paths or [ attrs.path ] else []; + anyAttrs = pred: cfg: any id (mapAttrsToList (const pred) cfg); + upstreamTests = concatMap mkTest [ { check = config.services.avahi.enable; path = ["nixos" "avahi"]; @@ -141,7 +143,7 @@ let { check = config.networking.bridges != {}; path = ["nixos" "networking" whichNet "bridge"]; } - { check = any (iface: iface.useDHCP) config.networking.interfaces; + { check = anyAttrs (i: i.useDHCP == true) config.networking.interfaces; path = ["nixos" "networking" whichNet "dhcpOneIf"]; } { check = config.networking.useDHCP; @@ -153,7 +155,7 @@ let { check = config.networking.sits != {}; path = ["nixos" "networking" whichNet "sit"]; } - { check = any (iface: iface.ip4 != []) config.networking.interfaces; + { check = anyAttrs (i: i.ip4 != []) config.networking.interfaces; path = ["nixos" "networking" whichNet "static"]; } { check = config.networking.vlans != {}; @@ -195,7 +197,7 @@ let path = ["nixos" "pumpio"]; } { check = config.hardware.opengl.driSupport - && services.xserver.enable; + && config.services.xserver.enable; path = ["nixos" "quake3"]; } { check = true; -- cgit 1.4.1