From 2e1a5b53ec2bec28d92db5acb416ad60e6760926 Mon Sep 17 00:00:00 2001 From: Nicolas Berbiche Date: Wed, 28 Jul 2021 20:52:25 -0400 Subject: [PATCH] xsession: don't reset the inherited keyboard options If the keyboard configuration is an empty set, don't run the setxkbmap service. The default values for all keyboard options are null or empty so long as the state version is set to 19.09 or higher (21.05 being the latest version). --- docs/release-notes/rl-2111.adoc | 2 +- modules/home-environment.nix | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-2111.adoc b/docs/release-notes/rl-2111.adoc index 3430fc987..ecd189956 100644 --- a/docs/release-notes/rl-2111.adoc +++ b/docs/release-notes/rl-2111.adoc @@ -44,4 +44,4 @@ The state version in this release includes the changes below. These changes are only active if the `home.stateVersion` option is set to "21.11" or later. -* Nothing has happened. +* The <> option now defaults to `null`, meaning that Home Manager won't do any keyboard layout management. For example, `setxkbmap` won't be run in X sessions. diff --git a/modules/home-environment.nix b/modules/home-environment.nix index f7fc721db..abfc3e7ee 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -4,6 +4,8 @@ with lib; let + inherit (config.home) stateVersion; + cfg = config.home; languageSubModule = types.submodule { @@ -220,7 +222,11 @@ in home.keyboard = mkOption { type = types.nullOr keyboardSubModule; - default = {}; + default = if versionAtLeast stateVersion "21.11" then null else { }; + defaultText = literalExpression '' + "{ }" for state version < 21.11, + "null" for state version ≥ 21.11 + ''; description = '' Keyboard configuration. Set to null to disable Home Manager keyboard management.