1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.services.xserver.windowManager.compiz;
8 xorg = config.services.xserver.package;
9
10in
11
12{
13
14 options = {
15
16 services.xserver.windowManager.compiz = {
17
18 enable = mkOption {
19 default = false;
20 description = "Enable the Compiz window manager.";
21 };
22
23 renderingFlag = mkOption {
24 default = "";
25 example = "--indirect-rendering";
26 description = "Pass the <option>--indirect-rendering</option> flag to Compiz.";
27 };
28
29 };
30
31 };
32
33
34 config = mkIf cfg.enable {
35
36 services.xserver.windowManager.session = singleton
37 { name = "compiz";
38 start =
39 ''
40 # Start Compiz using the flat-file configuration backend
41 # (ccp).
42 export COMPIZ_PLUGINDIR=${config.system.path}/lib/compiz
43 export COMPIZ_METADATADIR=${config.system.path}/share/compiz
44 ${pkgs.compiz}/bin/compiz ccp ${cfg.renderingFlag} &
45
46 # Start GTK-style window decorator.
47 ${pkgs.compiz}/bin/gtk-window-decorator &
48 '';
49 };
50
51 environment.systemPackages =
52 [ pkgs.compiz
53 pkgs.compiz_ccsm
54 pkgs.compiz_plugins_main
55 pkgs.compiz_plugins_extra
56 pkgs.libcompizconfig # for the "ccp" plugin
57 ];
58
59 environment.pathsToLink = [ "/lib/compiz" "/share/compiz" ];
60
61 };
62
63}