about summary refs log tree commit diff
path: root/users/tazjin/nixos/modules/desktop.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-09T15·04+0200
committertazjin <tazjin@tvl.su>2022-05-10T13·41+0000
commit5518f620bbec2e4407519a4a5b71073c9ed380af (patch)
treea27204451742773ce8d62c02f09a6c63a794a4b6 /users/tazjin/nixos/modules/desktop.nix
parentc4a3500d7024df199572c102420a4c8398344c1a (diff)
refactor(tazjin/nixos): Split up desktop/laptop configurations r/4047
Change-Id: I0f5d631491be0c811ad171510568aac097d2fddd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5553
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'users/tazjin/nixos/modules/desktop.nix')
-rw-r--r--users/tazjin/nixos/modules/desktop.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/users/tazjin/nixos/modules/desktop.nix b/users/tazjin/nixos/modules/desktop.nix
new file mode 100644
index 000000000000..c78463386c46
--- /dev/null
+++ b/users/tazjin/nixos/modules/desktop.nix
@@ -0,0 +1,53 @@
+# EXWM and other desktop configuration.
+{ depot, lib, pkgs, ... }:
+
+{
+  services = {
+    pipewire = {
+      enable = true;
+      alsa.enable = true;
+      pulse.enable = true;
+    };
+
+    redshift.enable = true;
+    blueman.enable = true;
+
+    xserver = {
+      enable = true;
+      layout = "us";
+      xkbOptions = "caps:super";
+
+      libinput.enable = true;
+
+      displayManager = {
+        # Give EXWM permission to control the session.
+        sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER";
+        lightdm.enable = true;
+        # lightdm.greeters.gtk.clock-format = "%H:%M"; # TODO(tazjin): TZ?
+      };
+
+      windowManager.session = lib.singleton {
+        name = "exwm";
+        start = "${depot.users.tazjin.emacs}/bin/tazjins-emacs";
+      };
+    };
+  };
+
+  # Set variables to enable EXWM-XIM and other Emacs features.
+  environment.sessionVariables = {
+    XMODIFIERS = "@im=exwm-xim";
+    GTK_IM_MODULE = "xim";
+    QT_IM_MODULE = "xim";
+    CLUTTER_IM_MODULE = "xim";
+    EDITOR = "emacsclient";
+  };
+
+  # Do not restart the display manager automatically
+  systemd.services.display-manager.restartIfChanged = lib.mkForce false;
+
+  # If something needs more than 10s to stop it should probably be
+  # killed.
+  systemd.extraConfig = ''
+    DefaultTimeoutStopSec=10s
+  '';
+}