From 93923296a916a138f45e604fa377429712540521 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 14 Aug 2013 17:29:42 +0200 Subject: [PATCH] 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 --- modules/services/x11/window-managers/i3.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/services/x11/window-managers/i3.nix b/modules/services/x11/window-managers/i3.nix index d688c064c5ac..6777a95ddc8c 100644 --- a/modules/services/x11/window-managers/i3.nix +++ b/modules/services/x11/window-managers/i3.nix @@ -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=$! "; }];