about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@higgsboson.tk>2016-10-22 11:49:24 +0200
committerGitHub <noreply@github.com>2016-10-22 11:49:24 +0200
commitb0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6 (patch)
tree6c162118e4921735eb809e2ddf3d92920af2396d /nixos
parent10167aaf563ead11ba4e96618f53da5eb91e6235 (diff)
parent137ce58317ac7afcfe5477848c8f34b5fbfd14d1 (diff)
downloadnixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar.gz
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar.bz2
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar.lz
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar.xz
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.tar.zst
nixlib-b0c38f450f1175ca0f5ba4a7f3ec041049e3bbf6.zip
Merge pull request #19347 from cedeel/bspwm-git
bspwm-unstable: init at 2016-09-30
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/x11/window-managers/bspwm-unstable.nix48
-rw-r--r--nixos/modules/services/x11/window-managers/default.nix1
3 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index ed52433994f9..a4ef5a985e9e 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -534,6 +534,7 @@
   ./services/x11/window-managers/fluxbox.nix
   ./services/x11/window-managers/icewm.nix
   ./services/x11/window-managers/bspwm.nix
+  ./services/x11/window-managers/bspwm-unstable.nix
   ./services/x11/window-managers/metacity.nix
   ./services/x11/window-managers/none.nix
   ./services/x11/window-managers/twm.nix
diff --git a/nixos/modules/services/x11/window-managers/bspwm-unstable.nix b/nixos/modules/services/x11/window-managers/bspwm-unstable.nix
new file mode 100644
index 000000000000..3282e0d0851f
--- /dev/null
+++ b/nixos/modules/services/x11/window-managers/bspwm-unstable.nix
@@ -0,0 +1,48 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.xserver.windowManager.bspwm-unstable;
+in
+
+{
+  options = {
+    services.xserver.windowManager.bspwm-unstable = {
+        enable = mkEnableOption "bspwm-unstable";
+        startThroughSession = mkOption {
+            type = with types; bool;
+            default = false;
+            description = "
+                Start the window manager through the script defined in 
+                sessionScript. Defaults to the the bspwm-session script
+                provided by bspwm
+            ";
+        };
+        sessionScript = mkOption {
+            default = "${pkgs.bspwm-unstable}/bin/bspwm-session";
+            defaultText = "(pkgs.bspwm-unstable)/bin/bspwm-session";
+            description = "
+                The start-session script to use. Defaults to the
+                provided bspwm-session script from the bspwm package.
+
+                Does nothing unless `bspwm.startThroughSession` is enabled
+            ";
+        };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    services.xserver.windowManager.session = singleton {
+      name = "bspwm-unstable";
+      start = if cfg.startThroughSession
+        then cfg.sessionScript
+        else ''
+            export _JAVA_AWT_WM_NONREPARENTING=1
+            SXHKD_SHELL=/bin/sh ${pkgs.sxhkd-unstable}/bin/sxhkd -f 100 &
+            ${pkgs.bspwm-unstable}/bin/bspwm
+        '';
+    };
+    environment.systemPackages = [ pkgs.bspwm-unstable ];
+  };
+}
diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix
index f005decfa33c..dabe2c26a72f 100644
--- a/nixos/modules/services/x11/window-managers/default.nix
+++ b/nixos/modules/services/x11/window-managers/default.nix
@@ -10,6 +10,7 @@ in
   imports = [
     ./afterstep.nix
     ./bspwm.nix
+    ./bspwm-unstable.nix
     ./compiz.nix
     ./dwm.nix
     ./exwm.nix