summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorAlan Pearce2017-09-10 14:38:36 +0200
committerAlan Pearce2017-09-10 14:38:36 +0200
commit94eaea428f207a3791e60092c3ef2a4a6e2fb669 (patch)
tree53ad526a2e0c735c748a11786957dbcd89d33799 /modules
parent45fcfe8435222078c2153f22b3f32d8bafb94633 (diff)
downloadnixos-configuration-94eaea428f207a3791e60092c3ef2a4a6e2fb669.tar.lz
nixos-configuration-94eaea428f207a3791e60092c3ef2a4a6e2fb669.tar.zst
nixos-configuration-94eaea428f207a3791e60092c3ef2a4a6e2fb669.zip
user-interface: Run emacs with --debug-init
Diffstat (limited to 'modules')
-rw-r--r--modules/user-interface.nix28
1 files changed, 15 insertions, 13 deletions
diff --git a/modules/user-interface.nix b/modules/user-interface.nix
index 3f4fb6e..d8a2b6a 100644
--- a/modules/user-interface.nix
+++ b/modules/user-interface.nix
@@ -1,8 +1,20 @@
-{ config, pkgs, ... }:
+{ config, pkgs, lib, ... }:
 
 let
   pkgsUnstable = import <nixos-unstable> {};
   # pkgsUnstable = pkgs;
+  emacsPackage = import ../packages/emacs.nix {
+    inherit (pkgs) stdenv;
+    pkgs = pkgsUnstable;
+    emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override {
+        withGTK2 = false;
+        withGTK3 = true;
+      }) (attrs: {
+        postInstall = attrs.postInstall + ''
+          rm $out/share/applications/emacs.desktop
+        '';
+      });
+  };
 in
 { # programs.browserpass.enable = true;
   programs.info.enable = true;
@@ -49,19 +61,9 @@ in
   services.emacs = {
     enable = true;
     defaultEditor = true;
-    package = import ../packages/emacs.nix {
-      inherit (pkgs) stdenv;
-      pkgs = pkgsUnstable;
-      emacs = pkgs.lib.overrideDerivation (pkgs.emacs.override {
-          withGTK2 = false;
-          withGTK3 = true;
-        }) (attrs: {
-          postInstall = attrs.postInstall + ''
-            rm $out/share/applications/emacs.desktop
-          '';
-        });
-    };
+    package = emacsPackage;
   };
+  systemd.user.services.emacs.serviceConfig.ExecStart = lib.mkForce "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${emacsPackage}/bin/emacs --daemon --debug-init'";
 
   services.redshift = {
     enable = true;