From b78ce79f895ff32f8781e47c34e016fe0f29b808 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 4 Jun 2012 21:19:12 +0200 Subject: [PATCH] Add xserver integration of i3 WM. This allows to set i3 as the default window manager in the system configuration. --- .../services/x11/window-managers/default.nix | 1 + modules/services/x11/window-managers/i3.nix | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 modules/services/x11/window-managers/i3.nix diff --git a/modules/services/x11/window-managers/default.nix b/modules/services/x11/window-managers/default.nix index 801517fdd9891..8adfca3cca985 100644 --- a/modules/services/x11/window-managers/default.nix +++ b/modules/services/x11/window-managers/default.nix @@ -14,6 +14,7 @@ in ./twm.nix ./wmii.nix ./xmonad.nix + ./i3.nix ]; options = { diff --git a/modules/services/x11/window-managers/i3.nix b/modules/services/x11/window-managers/i3.nix new file mode 100644 index 0000000000000..7699d064eeff0 --- /dev/null +++ b/modules/services/x11/window-managers/i3.nix @@ -0,0 +1,30 @@ +{pkgs, config, ...}: + +let + inherit (pkgs.lib) mkOption mkIf; + 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."; + }; + }; + }; + + config = { + services.xserver.windowManager = { + session = mkIf cfg.enable [{ + name = "i3"; + start = " + ${pkgs.i3}/bin/i3 & + waitPID=$! + "; + }]; + }; + }; +}