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