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