2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-08-14 16:29:42 +01:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2012-06-04 20:19:12 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.i3;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.windowManager.i3 = {
|
2015-12-04 09:38:23 +00:00
|
|
|
enable = mkEnableOption "i3";
|
2013-08-14 16:29:42 +01: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 20:19:12 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2012-07-12 10:33:10 +01:00
|
|
|
config = mkIf cfg.enable {
|
2012-06-04 20:19:12 +01:00
|
|
|
services.xserver.windowManager = {
|
2012-07-12 10:33:10 +01:00
|
|
|
session = [{
|
2012-06-04 20:19:12 +01:00
|
|
|
name = "i3";
|
2013-10-30 16:52:35 +00:00
|
|
|
start = ''
|
2013-08-14 16:29:42 +01:00
|
|
|
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
|
2015-10-27 10:40:04 +00:00
|
|
|
"-c \"${cfg.configFile}\""
|
2013-08-14 16:29:42 +01:00
|
|
|
} &
|
2012-06-04 20:19:12 +01:00
|
|
|
waitPID=$!
|
2013-10-30 16:52:35 +00:00
|
|
|
'';
|
2012-06-04 20:19:12 +01:00
|
|
|
}];
|
|
|
|
};
|
2016-02-08 04:31:03 +00:00
|
|
|
environment.systemPackages = with pkgs; [ i3 ];
|
2012-06-04 20:19:12 +01:00
|
|
|
};
|
|
|
|
}
|