at 16.09-beta 1.3 kB view raw
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 = mkEnableOption "compiz"; 19 20 renderingFlag = mkOption { 21 default = ""; 22 example = "--indirect-rendering"; 23 description = "Pass the <option>--indirect-rendering</option> flag to Compiz."; 24 }; 25 26 }; 27 28 }; 29 30 31 config = mkIf cfg.enable { 32 33 services.xserver.windowManager.session = singleton 34 { name = "compiz"; 35 start = 36 '' 37 # Start Compiz using the flat-file configuration backend 38 # (ccp). 39 export COMPIZ_PLUGINDIR=${config.system.path}/lib/compiz 40 export COMPIZ_METADATADIR=${config.system.path}/share/compiz 41 ${pkgs.compiz}/bin/compiz ccp ${cfg.renderingFlag} & 42 43 # Start GTK-style window decorator. 44 ${pkgs.compiz}/bin/gtk-window-decorator & 45 ''; 46 }; 47 48 environment.systemPackages = 49 [ pkgs.compiz 50 pkgs.compiz_ccsm 51 pkgs.compiz_plugins_main 52 pkgs.compiz_plugins_extra 53 pkgs.libcompizconfig # for the "ccp" plugin 54 ]; 55 56 environment.pathsToLink = [ "/lib/compiz" "/share/compiz" ]; 57 58 }; 59 60}