From 845d770d534402f45b50dfd9d3436bc9a5ae9563 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 3 May 2016 21:51:31 +0200 Subject: profiles/tests: Make keymap checks more granular Apart from an evaluation error (because ["nixos" "keymap"] results in an attrset rather than a plain derivation), checking for the active keymap explicitly makes more sense here. For example a user of a Neo keyboard layout won't care about a failure of the Dvorak keyboard layout and vice versa. Signed-off-by: aszlig --- modules/profiles/tests.nix | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/profiles/tests.nix b/modules/profiles/tests.nix index efb0caaf..94b8b88e 100644 --- a/modules/profiles/tests.nix +++ b/modules/profiles/tests.nix @@ -9,9 +9,6 @@ let anyAttrs = pred: cfg: any id (mapAttrsToList (const pred) cfg); - isDefault = path: (getAttrFromPath path options).default - == (getAttrFromPath path config); - upstreamTests = concatMap mkTest [ { check = config.services.avahi.enable; path = ["nixos" "avahi"]; @@ -128,10 +125,29 @@ let { check = config.services.xserver.desktopManager.kde4.enable; path = ["nixos" "kde4"]; } - { check = !(isDefault ["services" "xserver" "layout"]) - || !(isDefault ["services" "xserver" "xkbVariant"]) - || !(isDefault ["i18n" "consoleKeyMap"]); - path = ["nixos" "keymap"]; + { check = config.i18n.consoleKeyMap == "azerty/fr" + || config.services.xserver.layout == "fr"; + path = ["nixos" "keymap" "azerty"]; + } + { check = config.i18n.consoleKeyMap == "en-latin9" + || config.services.xserver.xkbVariant == "colemak"; + path = ["nixos" "keymap" "colemak"]; + } + { check = config.i18n.consoleKeyMap == "dvorak" + || config.services.xserver.layout == "dvorak"; + path = ["nixos" "keymap" "dvorak"]; + } + { check = config.i18n.consoleKeyMap == "dvp" + || config.services.xserver.xkbVariant == "dvp"; + path = ["nixos" "keymap" "dvp"]; + } + { check = config.i18n.consoleKeyMap == "neo" + || config.services.xserver.xkbVariant == "neo"; + path = ["nixos" "keymap" "neo"]; + } + { check = config.i18n.consoleKeyMap == "de" + || config.services.xserver.layout == "de"; + path = ["nixos" "keymap" "qwertz"]; } { check = with config.services.kubernetes; apiserver.enable || scheduler.enable || controllerManager.enable || kubelet.enable -- cgit 1.4.1