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>
This commit is contained in:
aszlig 2013-08-14 17:29:42 +02:00
parent 047b65dd68
commit 93923296a9
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -1,7 +1,8 @@
{pkgs, config, ...}:
{ pkgs, config, ... }:
with pkgs.lib;
let
inherit (pkgs.lib) mkOption mkIf;
cfg = config.services.xserver.windowManager.i3;
in
@ -13,6 +14,15 @@ in
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.
'';
};
};
};
@ -21,7 +31,9 @@ in
session = [{
name = "i3";
start = "
${pkgs.i3}/bin/i3 &
${pkgs.i3}/bin/i3 ${optionalString (cfg.configFile != null)
"-c \"${cfg.configFile}\""
} &
waitPID=$!
";
}];