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