2013-08-14 17:29:42 +02:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
2012-06-04 21:19:12 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.i3;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.windowManager.i3 = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable the i3 tiling window manager.";
|
|
|
|
};
|
2013-08-14 17:29:42 +02:00
|
|
|
|
|
|
|
configFile = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = types.nullOr types.path;
|
|
|
|
description = ''
|
|
|
|
Path to the i3 configuration file.
|
|
|
|
If left at the default value, $HOME/.i3/config will be used.
|
|
|
|
'';
|
|
|
|
};
|
2012-06-04 21:19:12 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2012-07-12 11:33:10 +02:00
|
|
|
config = mkIf cfg.enable {
|
2012-06-04 21:19:12 +02:00
|
|
|
services.xserver.windowManager = {
|
2012-07-12 11:33:10 +02:00
|
|
|
session = [{
|
2012-06-04 21:19:12 +02:00
|
|
|
name = "i3";
|
|
|
|
start = "
|
2013-08-14 17:29:42 +02:00
|
|
|
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
|
|
|
|
"-c \"${cfg.configFile}\""
|
|
|
|
} &
|
2012-06-04 21:19:12 +02:00
|
|
|
waitPID=$!
|
|
|
|
";
|
|
|
|
}];
|
|
|
|
};
|
2012-07-10 16:07:53 +02:00
|
|
|
environment.x11Packages = [ pkgs.i3 ];
|
2012-06-04 21:19:12 +02:00
|
|
|
};
|
|
|
|
}
|