diff options
author | aszlig <aszlig@redmoonstudios.org> | 2016-05-03 21:51:31 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2016-05-03 21:51:31 +0200 |
commit | 845d770d534402f45b50dfd9d3436bc9a5ae9563 (patch) | |
tree | 3fac22da5020bed731009c3f98379a9f63dc4320 /modules | |
parent | 52185e17867333878f4b7d9db232c33269cb7b80 (diff) |
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/profiles/tests.nix | 30 |
1 files changed, 23 insertions, 7 deletions
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 |