2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2010-10-20 00:25:53 +01:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2009-01-25 15:49:08 +00:00
|
|
|
|
|
|
|
let
|
2010-10-20 00:25:53 +01:00
|
|
|
|
2009-01-25 15:49:08 +00:00
|
|
|
cfg = config.services.xserver.windowManager.compiz;
|
|
|
|
xorg = config.services.xserver.package;
|
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
in
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
2009-01-25 15:49:08 +00:00
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
services.xserver.windowManager.compiz = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2009-01-25 15:49:08 +00:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
2010-10-20 00:25:53 +01:00
|
|
|
description = "Enable the Compiz window manager.";
|
2009-01-25 15:49:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
renderingFlag = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "--indirect-rendering";
|
2010-10-20 00:25:53 +01:00
|
|
|
description = "Pass the <option>--indirect-rendering</option> flag to Compiz.";
|
2009-01-25 15:49:08 +00:00
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2009-01-25 15:49:08 +00:00
|
|
|
};
|
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
};
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
services.xserver.windowManager.session = singleton
|
|
|
|
{ name = "compiz";
|
|
|
|
start =
|
|
|
|
''
|
|
|
|
# Start Compiz using the flat-file configuration backend
|
|
|
|
# (ccp).
|
|
|
|
export COMPIZ_PLUGINDIR=${config.system.path}/lib/compiz
|
|
|
|
export COMPIZ_METADATADIR=${config.system.path}/share/compiz
|
|
|
|
${pkgs.compiz}/bin/compiz ccp ${cfg.renderingFlag} &
|
|
|
|
|
|
|
|
# Start GTK-style window decorator.
|
|
|
|
${pkgs.compiz}/bin/gtk-window-decorator &
|
2009-01-25 15:49:08 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-10-20 00:25:53 +01:00
|
|
|
environment.systemPackages =
|
|
|
|
[ pkgs.compiz
|
|
|
|
pkgs.compiz_ccsm
|
|
|
|
pkgs.compiz_plugins_main
|
|
|
|
pkgs.compiz_plugins_extra
|
|
|
|
pkgs.libcompizconfig # for the "ccp" plugin
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.pathsToLink = [ "/lib/compiz" "/share/compiz" ];
|
2009-01-25 15:49:08 +00:00
|
|
|
|
|
|
|
};
|
2010-10-20 00:25:53 +01:00
|
|
|
|
2009-01-25 15:49:08 +00:00
|
|
|
}
|