nixpkgs/modules/services/x11/window-managers/i3.nix
aszlig 93923296a9
i3: Allow to pass a configuration file.
With this it's now possible to directly embed a configuration file
using `services.xserver.windowManager.i3.configFile = path`, which then
will be used instead of the one in the users home directory.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2013-08-14 17:33:06 +02:00

44 lines
920 B
Nix

{ pkgs, config, ... }:
with pkgs.lib;
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.";
};
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.
'';
};
};
};
config = mkIf cfg.enable {
services.xserver.windowManager = {
session = [{
name = "i3";
start = "
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
"-c \"${cfg.configFile}\""
} &
waitPID=$!
";
}];
};
environment.x11Packages = [ pkgs.i3 ];
};
}