1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8with lib;
9
10let
11 cfg = config.services.xserver.windowManager.wmderland;
12in
13
14{
15 options.services.xserver.windowManager.wmderland = {
16 enable = mkEnableOption "wmderland";
17
18 extraSessionCommands = mkOption {
19 default = "";
20 type = types.lines;
21 description = ''
22 Shell commands executed just before wmderland is started.
23 '';
24 };
25
26 extraPackages = mkOption {
27 type = with types; listOf package;
28 default = with pkgs; [
29 rofi
30 dunst
31 light
32 hsetroot
33 feh
34 rxvt-unicode
35 ];
36 defaultText = literalExpression ''
37 with pkgs; [
38 rofi
39 dunst
40 light
41 hsetroot
42 feh
43 rxvt-unicode
44 ]
45 '';
46 description = ''
47 Extra packages to be installed system wide.
48 '';
49 };
50 };
51
52 config = mkIf cfg.enable {
53 services.xserver.windowManager.session = singleton {
54 name = "wmderland";
55 start = ''
56 ${cfg.extraSessionCommands}
57
58 ${pkgs.wmderland}/bin/wmderland &
59 waitPID=$!
60 '';
61 };
62 environment.systemPackages = [
63 pkgs.wmderland
64 pkgs.wmderlandc
65 ] ++ cfg.extraPackages;
66 };
67}