1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 17:38:33 +02:00

xsession: deprecate xsession.windowManager

The intention is for the `xsession.windowManager` option to be
available for full modules in the future. The option
`xsession.windowManager.command` should now be used to specify the
window manager startup command.
This commit is contained in:
Robert Helgesson 2017-09-23 00:34:25 +02:00
parent bcff7274f4
commit 23d3539fcb
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86
2 changed files with 126 additions and 75 deletions

View File

@ -232,12 +232,29 @@ in
tool in that NIX_AUTO_INSTALL is not supported.
'';
}
{
time = "2017-09-28T12:39:36+00:00";
message = ''
A new program module is available: 'programs.rofi';
'';
}
{
time = "2017-09-28T21:39:45+00:00";
condition =
config.xsession.enable
&& config.xsession.windowManager.usesDeprecated;
message = ''
The 'xsession.windowManager' option is now deprecated,
please use 'xsession.windowManager.command' instead.
This change was made to prepare for window manager modules
under the 'xsession.windowManager' namespace. For example,
'xsession.windowManager.xmonad' and
'xsession.windowManager.i3'.
'';
}
];
};
}

View File

@ -6,6 +6,32 @@ let
cfg = config.xsession;
# Hack to support xsession.windowManager.command option.
wmBaseModule = {
options = {
command = mkOption {
type = types.str;
example = literalExample ''
let
xmonad = pkgs.xmonad-with-packages.override {
packages = self: [ self.xmonad-contrib self.taffybar ];
};
in
"''${xmonad}/bin/xmonad";
'';
description = ''
Window manager start command.
'';
};
usesDeprecated = mkOption {
internal = true;
type = types.bool;
default = false;
};
};
};
in
{
@ -16,16 +42,15 @@ in
enable = mkEnableOption "X Session";
windowManager = mkOption {
type = types.str;
example = literalExample ''
let
xmonad = pkgs.xmonad-with-packages.override {
packages = self: [ self.xmonad-contrib self.taffybar ];
};
in
"''${xmonad}/bin/xmonad";
type =
types.coercedTo
types.str
(command: { inherit command; usesDeprecated = true; })
(types.submodule wmBaseModule);
description = ''
Window manager start command. DEPRECATED: Use
<varname>xsession.windowManager.command</varname> instead.
'';
description = "Path to window manager to exec.";
};
initExtra = mkOption {
@ -36,7 +61,15 @@ in
};
};
config = mkIf cfg.enable {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.windowManager.usesDeprecated {
warnings = [
("xsession.windowManager is deprecated, "
+ "please use xsession.windowManager.command")
];
})
{
systemd.user.services.setxkbmap = {
Unit = {
Description = "Set up keyboard in X";
@ -95,7 +128,7 @@ in
${cfg.initExtra}
${cfg.windowManager}
${cfg.windowManager.command}
systemctl --user stop graphical-session.target
systemctl --user stop graphical-session-pre.target
@ -106,5 +139,6 @@ in
done
'';
};
};
}
]);
}