1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.services.xserver.windowManager;
7in
8
9{
10 imports = [
11 ./afterstep.nix
12 ./bspwm.nix
13 ./compiz.nix
14 ./dwm.nix
15 ./exwm.nix
16 ./fluxbox.nix
17 ./herbstluftwm.nix
18 ./i3.nix
19 ./jwm.nix
20 ./metacity.nix
21 ./mwm.nix
22 ./openbox.nix
23 ./pekwm.nix
24 ./notion.nix
25 ./ratpoison.nix
26 ./sawfish.nix
27 ./stumpwm.nix
28 ./spectrwm.nix
29 ./twm.nix
30 ./windowmaker.nix
31 ./wmii.nix
32 ./xmonad.nix
33 ./qtile.nix
34 ./none.nix ];
35
36 options = {
37
38 services.xserver.windowManager = {
39
40 session = mkOption {
41 internal = true;
42 default = [];
43 example = [{
44 name = "wmii";
45 start = "...";
46 }];
47 description = ''
48 Internal option used to add some common line to window manager
49 scripts before forwarding the value to the
50 <varname>displayManager</varname>.
51 '';
52 apply = map (d: d // {
53 manage = "window";
54 });
55 };
56
57 default = mkOption {
58 type = types.str;
59 default = "none";
60 example = "wmii";
61 description = "Default window manager loaded if none have been chosen.";
62 apply = defaultWM:
63 if any (w: w.name == defaultWM) cfg.session then
64 defaultWM
65 else
66 throw "Default window manager (${defaultWM}) not found.";
67 };
68
69 };
70
71 };
72
73 config = {
74 services.xserver.displayManager.session = cfg.session;
75 };
76}