mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-03 12:27:27 -05:00
Merge pull request #326 from thiagokokada/workaround-doom-modeline-issues
Workaround doom-modeline issues
This commit is contained in:
19
default.nix
19
default.nix
@ -75,7 +75,7 @@
|
|||||||
*/
|
*/
|
||||||
, dependencyOverrides ? { }
|
, dependencyOverrides ? { }
|
||||||
, lib, pkgs, stdenv, buildEnv, makeWrapper
|
, lib, pkgs, stdenv, buildEnv, makeWrapper
|
||||||
, runCommand, fetchFromGitHub, substituteAll, writeShellScript
|
, runCommand, fetchFromGitHub, writeShellScript
|
||||||
, writeShellScriptBin, writeTextDir }:
|
, writeShellScriptBin, writeTextDir }:
|
||||||
|
|
||||||
assert (lib.assertMsg ((builtins.isPath doomPrivateDir)
|
assert (lib.assertMsg ((builtins.isPath doomPrivateDir)
|
||||||
@ -136,7 +136,7 @@ let
|
|||||||
emacsPackages.overrideScope' overrides;
|
emacsPackages.overrideScope' overrides;
|
||||||
emacs = emacsPackages.emacsWithPackages extraPackages;
|
emacs = emacsPackages.emacsWithPackages extraPackages;
|
||||||
emacsLoadFiles = [ ./advice.el ];
|
emacsLoadFiles = [ ./advice.el ];
|
||||||
emacsArgs = [ "--" "install" ];
|
emacsArgs = [ "--" "install" "--no-hooks" "--no-fonts" "--no-env" ];
|
||||||
|
|
||||||
# Need to reference a store path here, as byte-compilation will bake-in
|
# Need to reference a store path here, as byte-compilation will bake-in
|
||||||
# absolute path to source files.
|
# absolute path to source files.
|
||||||
@ -193,16 +193,13 @@ let
|
|||||||
src = doomSrc;
|
src = doomSrc;
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
(substituteAll {
|
./patches/nix-integration.patch
|
||||||
src = ./patches/nix-integration.patch;
|
|
||||||
local = doomLocal;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
patchShebangs bin
|
|
||||||
# Remove the windows wrapper for the CLI so the build doesn't fail
|
# Remove the windows wrapper for the CLI so the build doesn't fail
|
||||||
rm bin/doom.cmd
|
rm bin/doom.cmd
|
||||||
|
patchShebangs bin
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
@ -220,6 +217,7 @@ let
|
|||||||
chmod u+w $out/config.el
|
chmod u+w $out/config.el
|
||||||
cat $extraConfigPath > $out/config.extra.el
|
cat $extraConfigPath > $out/config.extra.el
|
||||||
cat > $out/config.el << EOF
|
cat > $out/config.el << EOF
|
||||||
|
(load "${./workarounds.el}")
|
||||||
(load "${doomPrivateDir}/config.el")
|
(load "${doomPrivateDir}/config.el")
|
||||||
(load "$out/config.extra.el")
|
(load "$out/config.extra.el")
|
||||||
EOF
|
EOF
|
||||||
@ -229,8 +227,7 @@ let
|
|||||||
# without installing ~/.emacs.d
|
# without installing ~/.emacs.d
|
||||||
emacs = let
|
emacs = let
|
||||||
load-config-from-site = writeTextDir "share/emacs/site-lisp/default.el" ''
|
load-config-from-site = writeTextDir "share/emacs/site-lisp/default.el" ''
|
||||||
(message "doom-emacs is not placed in `doom-private-dir',
|
(message "doom-emacs is not placed in `doom-private-dir', loading from `site-lisp'")
|
||||||
loading from `site-lisp'")
|
|
||||||
${# TODO: remove once Emacs 29+ is released and commonly available
|
${# TODO: remove once Emacs 29+ is released and commonly available
|
||||||
lib.optionalString (!isEmacs29) ''
|
lib.optionalString (!isEmacs29) ''
|
||||||
(load "${doom-emacs}/early-init.el")
|
(load "${doom-emacs}/early-init.el")
|
||||||
@ -271,10 +268,10 @@ in emacs.overrideAttrs (esuper:
|
|||||||
wrapEmacs() {
|
wrapEmacs() {
|
||||||
local -a wrapArgs=(
|
local -a wrapArgs=(
|
||||||
--set NIX_DOOM_EMACS_BINARY $1
|
--set NIX_DOOM_EMACS_BINARY $1
|
||||||
|
--set __DEBUG_doom_emacs_DIR ${doom-emacs}
|
||||||
|
--set __DEBUG_doomLocal_DIR ${doomLocal}
|
||||||
--set-default DOOMDIR ${doomDir}
|
--set-default DOOMDIR ${doomDir}
|
||||||
--set-default DOOMLOCALDIR ${doomLocal}
|
--set-default DOOMLOCALDIR ${doomLocal}
|
||||||
--set-default __DEBUG_doom_emacs_DIR ${doom-emacs}
|
|
||||||
--set-default __DEBUG_doomLocal_DIR ${doomLocal}
|
|
||||||
)
|
)
|
||||||
${initDirArgs}
|
${initDirArgs}
|
||||||
|
|
||||||
|
18
flake.lock
generated
18
flake.lock
generated
@ -17,23 +17,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"doom-modeline": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1648449595,
|
|
||||||
"narHash": "sha256-HjULFxtNDAJ7PDpy/e2bhoDYgBjwGpBdBoTY135puYA=",
|
|
||||||
"owner": "seagle0128",
|
|
||||||
"repo": "doom-modeline",
|
|
||||||
"rev": "ce9899f00af40edb78f58b9af5c3685d67c8eed2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "seagle0128",
|
|
||||||
"repo": "doom-modeline",
|
|
||||||
"rev": "ce9899f00af40edb78f58b9af5c3685d67c8eed2",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"doom-snippets": {
|
"doom-snippets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -356,7 +339,6 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"doom-emacs": "doom-emacs",
|
"doom-emacs": "doom-emacs",
|
||||||
"doom-modeline": "doom-modeline",
|
|
||||||
"doom-snippets": "doom-snippets",
|
"doom-snippets": "doom-snippets",
|
||||||
"emacs-overlay": "emacs-overlay",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"emacs-so-long": "emacs-so-long",
|
"emacs-so-long": "emacs-so-long",
|
||||||
|
@ -39,9 +39,6 @@
|
|||||||
# TODO: change back to master once we get synced back with upstream changes
|
# TODO: change back to master once we get synced back with upstream changes
|
||||||
doom-emacs.url = "github:doomemacs/doomemacs/3853dff5e11655e858d0bfae64b70cb12ef685ac";
|
doom-emacs.url = "github:doomemacs/doomemacs/3853dff5e11655e858d0bfae64b70cb12ef685ac";
|
||||||
doom-emacs.flake = false;
|
doom-emacs.flake = false;
|
||||||
# TODO remove pin once we get synced back with upstream changes
|
|
||||||
doom-modeline.url = "github:seagle0128/doom-modeline/ce9899f00af40edb78f58b9af5c3685d67c8eed2";
|
|
||||||
doom-modeline.flake = false;
|
|
||||||
doom-snippets.url = "github:doomemacs/snippets";
|
doom-snippets.url = "github:doomemacs/snippets";
|
||||||
doom-snippets.flake = false;
|
doom-snippets.flake = false;
|
||||||
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
|
@ -8,15 +8,6 @@ self: super: {
|
|||||||
buildPhase = ":";
|
buildPhase = ":";
|
||||||
} // args);
|
} // args);
|
||||||
|
|
||||||
doom-modeline = self.straightBuild {
|
|
||||||
pname = "doom-modeline";
|
|
||||||
propagatedBuildInputs = with self; [
|
|
||||||
all-the-icons
|
|
||||||
compat
|
|
||||||
shrink-path
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
doom-snippets = self.straightBuild {
|
doom-snippets = self.straightBuild {
|
||||||
pname = "doom-snippets";
|
pname = "doom-snippets";
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
57
workarounds.el
Normal file
57
workarounds.el
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
;;; workarounds.el --- Description -*- lexical-binding: t; -*-
|
||||||
|
;;; Re-added functions removed in https://github.com/seagle0128/doom-modeline/commit/b596440ee78b3e7d2debc3d73f4d938d968fb896
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-minimal-modeline ()
|
||||||
|
"Set minimal mode-line."
|
||||||
|
(doom-modeline-set-modeline 'minimal))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-special-modeline ()
|
||||||
|
"Set special mode-line."
|
||||||
|
(doom-modeline-set-modeline 'special))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-project-modeline ()
|
||||||
|
"Set project mode-line."
|
||||||
|
(doom-modeline-set-modeline 'project))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-dashboard-modeline ()
|
||||||
|
"Set dashboard mode-line."
|
||||||
|
(doom-modeline-set-modeline 'dashboard))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-vcs-modeline ()
|
||||||
|
"Set vcs mode-line."
|
||||||
|
(doom-modeline-set-modeline 'vcs))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-info-modeline ()
|
||||||
|
"Set Info mode-line."
|
||||||
|
(doom-modeline-set-modeline 'info))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-package-modeline ()
|
||||||
|
"Set package mode-line."
|
||||||
|
(doom-modeline-set-modeline 'package))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-media-modeline ()
|
||||||
|
"Set media mode-line."
|
||||||
|
(doom-modeline-set-modeline 'media))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-message-modeline ()
|
||||||
|
"Set message mode-line."
|
||||||
|
(doom-modeline-set-modeline 'message))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-pdf-modeline ()
|
||||||
|
"Set pdf mode-line."
|
||||||
|
(doom-modeline-set-modeline 'pdf))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom-modeline-set-org-src-modeline ()
|
||||||
|
"Set org-src mode-line."
|
||||||
|
(doom-modeline-set-modeline 'org-src))
|
Reference in New Issue
Block a user