about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-11-15T17·34+0100
committerVincent Ambo <tazjin@gmail.com>2017-11-15T17·37+0100
commit7ca55c3fd5bb3434c4e1f5b30821a5d1a56fbced (patch)
tree430900e8c37e30cdbc895ae7f268ae3f83e68ea5
parentd79b7f45e70ca5250a5421dd4dab330dda17ad36 (diff)
feat(desktop): Move from i3 to exwm
Emacs just controls everything now. Why not!

Rather than using the builtin NixOS support for EXWM I've added a
custom snippet that takes care of the launching. This assumes that the
user launching the session has my emacs configuration installed, which
I, in practice, always do.

* remove setup of i3wm (until I'm comfortable using exwm I will keep
  the i3 configuration files around)
* disable compton (exwm brings its own compositor)
* disable auto-starting of emacs user service
* enable & configure exwm (also see correlating commits in my emacs.d
  repository)
-rw-r--r--configuration.nix2
-rw-r--r--desktop.nix21
2 files changed, 12 insertions, 11 deletions
diff --git a/configuration.nix b/configuration.nix
index 899735e05d4d..0553c8cf4e4c 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -26,7 +26,7 @@
 
   # Configure emacs:
   # (actually, that's a lie, this only installs emacs!)
-  services.emacs.enable = true;
+  services.emacs.install = true;
   services.emacs.defaultEditor = true;
 
   # Enable GNOME keyring (required for Evolution)
diff --git a/desktop.nix b/desktop.nix
index 284789dec5a6..12149a07288a 100644
--- a/desktop.nix
+++ b/desktop.nix
@@ -1,6 +1,6 @@
 # Configuration for the desktop environment
 
-{ config, pkgs, ... }:
+{ config, lib, pkgs, ... }:
 
 let wallpapers = import ./pkgs/wallpapers.nix;
 in {
@@ -9,18 +9,19 @@ in {
     enable = true;
     layout = "us,no";
     xkbOptions = "caps:super, grp:shifts_toggle";
-  };
 
-  # configure desktop environment:
-  services.xserver.windowManager.i3 = {
-    enable = true;
-    configFile = "/etc/i3/config";
+    # Give EXWM permission to control the session.
+    displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER";
   };
 
-  services.compton.enable = true;
-  # this should be the default! in fact, it will soon be:
-  # https://github.com/NixOS/nixpkgs/pull/30486
-  services.compton.backend = "xrender";
+  # Configure desktop environment:
+  services.xserver.windowManager.session = lib.singleton {
+    name = "exwm";
+    start = ''
+      ${pkgs.emacs}/bin/emacs --daemon -f exwm-enable
+      emacsclient -c
+    '';
+  };
 
   # Configure Redshift for Oslo
   services.redshift = {