2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-08-14 17:29:42 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with 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.
|
|
|
|
'';
|
|
|
|
};
|
2015-10-26 22:30:59 +01:00
|
|
|
|
|
|
|
debug = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = "Enable debug/verbose logging (see -V option)";
|
|
|
|
};
|
|
|
|
|
|
|
|
logFile = mkOption {
|
|
|
|
default = null;
|
|
|
|
example = "$HOME/.i3/i3log";
|
|
|
|
type = types.string;
|
|
|
|
description = ''
|
|
|
|
Path to a logfile for i3.
|
|
|
|
If left at the default value, logs will appear in display-manager.service's logs.
|
|
|
|
'';
|
|
|
|
};
|
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";
|
2013-10-30 17:52:35 +01:00
|
|
|
start = ''
|
2013-08-14 17:29:42 +02:00
|
|
|
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
|
2015-10-26 22:30:59 +01:00
|
|
|
''-c "${cfg.configFile}"''
|
|
|
|
} ${optionalString cfg.debug
|
|
|
|
''-V''
|
|
|
|
} ${optionalString (cfg.logFile != null)
|
|
|
|
''>> "${cfg.logFile}"''
|
2013-08-14 17:29:42 +02:00
|
|
|
} &
|
2012-06-04 21:19:12 +02:00
|
|
|
waitPID=$!
|
2013-10-30 17:52:35 +01:00
|
|
|
'';
|
2012-06-04 21:19:12 +02:00
|
|
|
}];
|
|
|
|
};
|
2013-10-30 17:52:35 +01:00
|
|
|
environment.systemPackages = [ pkgs.i3 ];
|
2012-06-04 21:19:12 +02:00
|
|
|
};
|
|
|
|
}
|