From c00689534482402a196f37bc0f3e89159af596d3 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 29 Jan 2024 08:21:26 +0000 Subject: [PATCH] Enable emacs service on socket activation Move emacs dependencies into home/emacs/default.nix to avoid having two files Don't start emacs server from hyprland startup now Remove firefox home module, use system module only --- home/emacs/default.nix | 59 ++++++++++++++++++++++++++++++++++++++- home/hyprland/default.nix | 3 +- system/chromium.nix | 2 +- system/emacs.nix | 52 ---------------------------------- system/hyprland.nix | 2 +- 5 files changed, 61 insertions(+), 57 deletions(-) delete mode 100644 system/emacs.nix diff --git a/home/emacs/default.nix b/home/emacs/default.nix index 58f5b249..99b33d43 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ config, pkgs, ... }: { programs.emacs = { # Clone emacs config from https://git.xenia.me.uk/xenia/emacs.git enable = true; @@ -103,4 +103,61 @@ elfeed-tube-mpv ]; }; + services.emacs = { + enable = true; + package = config.programs.emacs.finalPackage; + startWithUserSession = false; + defaultEditor = true; + client.enable = true; + socketActivation.enable = true; + }; + home.packages = with pkgs; [ + # Emacs requirements + fd + ripgrep + imagemagick + languagetool + wordnet + (aspellWithDicts (ds: with ds; [ en en-computers en-science ])) + + # For org-plot + gnuplot + + # For EMMS + mp3info + + # Language-specific requirements + sqlite + pandoc + ghostscript + mupdf + poppler_utils + + # Customised LaTeX install + # texlive.combined.scheme-full + (texlive.combine { + inherit (pkgs.texlive) + scheme-basic dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of; + }) + + # Linters + shellcheck + + # Formatters + nodePackages.prettier + nixfmt + ruff + isort + fprettify + rustfmt + stylua + shfmt + + # LSP Servers + nil + fortls + rust-analyzer + luajitPackages.lua-lsp + python3Packages.jedi-language-server + ]; } diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 53bcae7e..29a508eb 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -8,7 +8,6 @@ ../swaync/default.nix ../emacs/default.nix ../nyxt/default.nix - ../firefox/default.nix ../obs/default.nix ]; services = { @@ -87,7 +86,7 @@ ]; exec-once = with config; [ "hyprctl setcursor ${gtk.theme.name} ${toString gtk.cursorTheme.size}" - "git -C $HOME/.emacs pull --ff-only; emacs --fg-daemon" + "git -C $HOME/.emacs pull --ff-only" "swaync" "${pkgs.hyprpaper}/bin/hyprpaper" "${pkgs.dex}/bin/dex --autostart" diff --git a/system/chromium.nix b/system/chromium.nix index 226b8d7a..ec62cb5c 100644 --- a/system/chromium.nix +++ b/system/chromium.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ ... }: { programs.chromium = rec { enable = true; defaultSearchProviderEnabled = true; diff --git a/system/emacs.nix b/system/emacs.nix deleted file mode 100644 index 7eb74e4d..00000000 --- a/system/emacs.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ - # Emacs + requirements - emacs29-pgtk - fd - ripgrep - imagemagick - languagetool - wordnet - (aspellWithDicts (ds: with ds; [ en en-computers en-science ])) - - # For org-plot - gnuplot - - # For EMMS - mp3info - - # Language-specific requirements - sqlite - pandoc - ghostscript - mupdf - poppler_utils - - # Customised LaTeX install - # texlive.combined.scheme-full - (texlive.combine { - inherit (pkgs.texlive) - scheme-basic dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of; - }) - - # Linters - shellcheck - - # Formatters - nodePackages.prettier - nixfmt - ruff - isort - fprettify - rustfmt - stylua - shfmt - - # LSP Servers - nil - fortls - rust-analyzer - luajitPackages.lua-lsp - python3Packages.jedi-language-server - ]; -} diff --git a/system/hyprland.nix b/system/hyprland.nix index 00423766..6807412a 100644 --- a/system/hyprland.nix +++ b/system/hyprland.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { - imports = [ ./desktop.nix ./emacs.nix ./firefox.nix ./chromium.nix ]; + imports = [ ./desktop.nix ./firefox.nix ./chromium.nix ]; nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; environment = {