From dbe9ab45d9eb2f4223bb1e8a929c0234098d8100 Mon Sep 17 00:00:00 2001 From: Xe Date: Sat, 14 Jan 2023 22:45:00 -0500 Subject: [PATCH] Revert "fix emacs build" This reverts commit 8e2ef1948a0d3abe264f5f48109265da2c722c72. --- common/home-manager/emacs/default.nix | 4 +- .../emacs/emacs-init-defaults.nix | 146 ------------------ common/home-manager/emacs/emacs-init.nix | 19 --- 3 files changed, 2 insertions(+), 167 deletions(-) delete mode 100644 common/home-manager/emacs/emacs-init-defaults.nix diff --git a/common/home-manager/emacs/default.nix b/common/home-manager/emacs/default.nix index b2150c6..50a96c1 100644 --- a/common/home-manager/emacs/default.nix +++ b/common/home-manager/emacs/default.nix @@ -107,7 +107,7 @@ in { counsel = { enable = true; - bind = { + bindStar = { "M-x" = "counsel-M-x"; "C-x C-f" = "counsel-find-file"; "C-x C-r" = "counsel-recentf"; @@ -308,7 +308,7 @@ in { swiper = { enable = true; - bind = { "C-s" = "swiper"; }; + bindStar = { "C-s" = "swiper"; }; general = '' (general-nmap diff --git a/common/home-manager/emacs/emacs-init-defaults.nix b/common/home-manager/emacs/emacs-init-defaults.nix deleted file mode 100644 index f81c558..0000000 --- a/common/home-manager/emacs/emacs-init-defaults.nix +++ /dev/null @@ -1,146 +0,0 @@ -# A collection of "uncontroversial" configurations for selected packages. - -{ pkgs, lib, config, ... }: - -{ - programs.emacs.init.usePackage = { - all-the-icons = { extraPackages = [ pkgs.emacs-all-the-icons-fonts ]; }; - - cmake-mode.mode = [ - ''"\\.cmake\\'"'' # \ - ''"CMakeLists.txt\\'"'' - ]; - - csharp-mode.mode = [ ''"\\.cs\\'"'' ]; - - cue-mode = { - package = epkgs: - epkgs.trivialBuild { - pname = "cue-mode.el"; - src = pkgs.fetchurl { - url = - "https://raw.githubusercontent.com/russell/cue-mode/9c803ee8fa4a6e99c7dc9ae373c6178569583b7a/cue-mode.el"; - sha256 = "0swhpknkg1vwbchblzrwynixf5grg95jy1bkc8w92yfpb1jch7m7"; - }; - preferLocalBuild = true; - allowSubstitutes = true; - }; - command = [ "cue-mode" ]; - mode = [ ''"\\.cue\\'"'' ]; - hook = [ "(cue-mode . subword-mode)" ]; - }; - - dap-lldb = { - config = '' - (setq dap-lldb-debug-program "${pkgs.lldb}/bin/lldb-vscode") - ''; - }; - - deadgrep = { - config = '' - (setq deadgrep-executable "${pkgs.ripgrep}/bin/rg") - ''; - }; - - dhall-mode.mode = [ ''"\\.dhall\\'"'' ]; - - dockerfile-mode.mode = [ ''"Dockerfile\\'"'' ]; - - elm-mode.mode = [ ''"\\.elm\\'"'' ]; - - emacsql-sqlite3 = { - enable = - lib.mkDefault config.programs.emacs.init.usePackage.org-roam.enable; - defer = lib.mkDefault true; - config = '' - (setq emacsql-sqlite3-executable "${pkgs.sqlite}/bin/sqlite3") - ''; - }; - - ggtags = { - config = '' - (setq ggtags-executable-directory "${pkgs.global}/bin") - ''; - }; - - idris-mode = { - mode = [ ''"\\.idr\\'"'' ]; - config = '' - (setq idris-interpreter-path "${pkgs.idris}/bin/idris") - ''; - }; - - kotlin-mode = { - mode = [ ''"\\.kts?\\'"'' ]; - hook = [ "(kotlin-mode . subword-mode)" ]; - }; - - latex.mode = [ ''("\\.tex\\'" . latex-mode)'' ]; - - lsp-eslint = { - config = '' - (setq lsp-eslint-server-command '("node" "${pkgs.vscode-extensions.dbaeumer.vscode-eslint}/share/vscode/extensions/dbaeumer.vscode-eslint/server/out/eslintServer.js" "--stdio")) - ''; - }; - - markdown-mode = { - mode = [ ''"\\.mdwn\\'"'' ''"\\.markdown\\'"'' ''"\\.md\\'"'' ]; - }; - - nix-mode.mode = [ ''"\\.nix\\'"'' ]; - - notmuch = { - package = epkgs: lib.getOutput "emacs" pkgs.notmuch; - config = '' - (setq notmuch-command "${pkgs.notmuch}/bin/notmuch") - ''; - }; - - octave.mode = [ ''("\\.m\\'" . octave-mode)'' ]; - - ob-plantuml = { - config = '' - (setq org-plantuml-jar-path "${pkgs.plantuml}/lib/plantuml.jar") - ''; - }; - - org-roam = { - defines = [ "org-roam-graph-executable" ]; - config = '' - (setq org-roam-graph-executable "${pkgs.graphviz}/bin/dot") - ''; - }; - - pandoc-mode = { - config = '' - (setq pandoc-binary "${pkgs.pandoc}/bin/pandoc") - ''; - }; - - php-mode.mode = [ ''"\\.php\\'"'' ]; - - plantuml-mode = { - mode = [ ''"\\.puml\\'"'' ]; - config = '' - (setq plantuml-default-exec-mode 'executable - plantuml-executable-path "${pkgs.plantuml}/bin/plantuml") - ''; - }; - - protobuf-mode.mode = [ ''"\\.proto\\'"'' ]; - - purescript-mode.mode = [ ''"\\.purs\\'"'' ]; - - ripgrep = { - config = '' - (setq ripgrep-executable "${pkgs.ripgrep}/bin/rg") - ''; - }; - - rust-mode.mode = [ ''"\\.rs\\'"'' ]; - - terraform-mode.mode = [ ''"\\.tf\\'"'' ]; - - yaml-mode.mode = [ ''"\\.\\(e?ya?\\|ra\\)ml\\'"'' ]; - }; -} diff --git a/common/home-manager/emacs/emacs-init.nix b/common/home-manager/emacs/emacs-init.nix index d32ac82..6121990 100644 --- a/common/home-manager/emacs/emacs-init.nix +++ b/common/home-manager/emacs/emacs-init.nix @@ -152,14 +152,6 @@ let ''; }; - general = mkOption { - type = types.lines; - default = ""; - description = '' - Code to place in the section. - ''; - }; - hook = mkOption { type = types.listOf types.str; default = [ ]; @@ -222,7 +214,6 @@ let let mkMap = n: v: mkBindHelper "bind" ":map ${n}" v; in flatten (mapAttrsToList mkMap bs); mkBindKeyMap = mkBindHelper "bind-keymap" ""; - extraAfter = optional (config.general != "") "general"; mkChords = mkBindHelper "chords" ""; mkHook = map (v: ":hook ${v}"); mkDefer = v: @@ -241,7 +232,6 @@ let ++ mkMode config.mode ++ optionals (config.init != "") [ ":init" config.init ] ++ optionals (config.config != "") [ ":config" config.config ] - ++ optionals (config.general != "") [ ":general" config.general ] ++ optional (config.extraConfig != "") config.extraConfig) + ")"; }; }); @@ -309,9 +299,6 @@ let # Whether the configuration makes use of `:chords`. hasChords = any (p: p.chords != { }) (attrValues cfg.usePackage); - # Whether the configuration makes use of `:general`. - hasGeneral = any (p: p.general != "") (attrValues cfg.usePackage); - usePackageSetup = '' (eval-when-compile (require 'use-package) @@ -333,11 +320,6 @@ let ;; For :chords in (use-package). (use-package use-package-chords :config (key-chord-mode 1)) - '' + optionalString hasGeneral '' - ;; For :general in (use-package). - (use-package general - :config - (general-evil-setup)) ''; earlyInitFile = '' @@ -513,7 +495,6 @@ in { src = pkgs.writeText "hm-init.el" initFile; packageRequires = [ epkgs.use-package ] ++ packages ++ optional hasBind epkgs.bind-key - ++ optional hasGeneral epkgs.general ++ optional hasDiminish epkgs.diminish ++ optional hasChords epkgs.use-package-chords; preferLocalBuild = true;