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