summary refs log tree commit diff
path: root/nixos/modules/services/x11/window-managers
diff options
context:
space:
mode:
authorChris Darnell <chris@cedeel.com>2016-10-07 23:35:31 -0400
committerChris Darnell <chris@cedeel.com>2016-10-16 01:28:11 -0400
commit137ce58317ac7afcfe5477848c8f34b5fbfd14d1 (patch)
tree9a6bdd6103df4815ee8e39deddf51af980e06c43 /nixos/modules/services/x11/window-managers
parent02d7fbb678b7ee1749466143202c9651b428cd0f (diff)
downloadnixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar.gz
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar.bz2
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar.lz
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar.xz
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.tar.zst
nixpkgs-137ce58317ac7afcfe5477848c8f34b5fbfd14d1.zip
bspwm-unstable: init at 2016-09-30
Diffstat (limited to 'nixos/modules/services/x11/window-managers')
-rw-r--r--nixos/modules/services/x11/window-managers/bspwm-unstable.nix48
-rw-r--r--nixos/modules/services/x11/window-managers/default.nix1
2 files changed, 49 insertions, 0 deletions
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 00000000000..3282e0d0851
--- /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 f005decfa33..dabe2c26a72 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