summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
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 3f4fb6e6..d8a2b6a4 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;