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