diff options
author | Robert Helgesson <robert@rycee.net> | 2019-09-05 01:37:45 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-09-05 01:56:06 +0200 |
commit | 824d31a21c7199a20f55dcb5f6311178e706dd72 (patch) | |
tree | ca58b7276cb0b9bba1da59df6f3f9c855223c4b4 /tests/modules/misc | |
parent | 0083087e01af2b336be1f5009c3bbdebd040458a (diff) |
keyboard: make `layout` and `variant` optional
Also default these options to `null` for state version ≥ 19.09.
Fixes #811
Suggested-by: Sean Marshallsay <srm.1708@gmail.com>
Diffstat (limited to 'tests/modules/misc')
-rw-r--r-- | tests/modules/misc/xsession/default.nix | 1 | ||||
-rw-r--r-- | tests/modules/misc/xsession/keyboard-without-layout-expected.service | 12 | ||||
-rw-r--r-- | tests/modules/misc/xsession/keyboard-without-layout.nix | 33 |
3 files changed, 46 insertions, 0 deletions
diff --git a/tests/modules/misc/xsession/default.nix b/tests/modules/misc/xsession/default.nix index fdacd3bbc39..2ddbf47efac 100644 --- a/tests/modules/misc/xsession/default.nix +++ b/tests/modules/misc/xsession/default.nix @@ -1,3 +1,4 @@ { xsession-basic = ./basic.nix; + xsession-keyboard-without-layout = ./keyboard-without-layout.nix; } diff --git a/tests/modules/misc/xsession/keyboard-without-layout-expected.service b/tests/modules/misc/xsession/keyboard-without-layout-expected.service new file mode 100644 index 00000000000..a04af53dad7 --- /dev/null +++ b/tests/modules/misc/xsession/keyboard-without-layout-expected.service @@ -0,0 +1,12 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@setxkbmap@/bin/setxkbmap -option 'ctrl:nocaps' -option 'altwin:no_win' +RemainAfterExit=true +Type=oneshot + +[Unit] +After=graphical-session-pre.target +Description=Set up keyboard in X +PartOf=graphical-session.target diff --git a/tests/modules/misc/xsession/keyboard-without-layout.nix b/tests/modules/misc/xsession/keyboard-without-layout.nix new file mode 100644 index 00000000000..b7eb3decebb --- /dev/null +++ b/tests/modules/misc/xsession/keyboard-without-layout.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + config = { + home.stateVersion = "19.09"; + + home.homeDirectory = "/test-home"; + + home.keyboard = { + options = [ "ctrl:nocaps" "altwin:no_win" ]; + }; + + xsession = { + enable = true; + windowManager.command = "window manager command"; + importedVariables = [ "EXTRA_IMPORTED_VARIABLE" ]; + initExtra = "init extra commands"; + profileExtra = "profile extra commands"; + }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/setxkbmap.service + assertFileContent \ + home-files/.config/systemd/user/setxkbmap.service \ + ${pkgs.substituteAll { + src = ./keyboard-without-layout-expected.service; + inherit (pkgs.xorg) setxkbmap; + }} + ''; + }; +} |