refactor: create an emacs wrapper

Why this is being done is just to include texliveTeTeX in my Emacs package. This is done because I want to be able to export PDFs without ever needing to remember to make a new devShell just for a document.
This commit is contained in:
Artur Manuel 2024-08-26 20:14:34 +01:00
commit c704b661ec
Failed to generate hash of commit

View file

@ -1,49 +1,60 @@
{ emacsWithPackagesFromUsePackage, emacs29-pgtk, python3, texliveTeTeX }:
emacsWithPackagesFromUsePackage {
{ symlinkJoin, emacsWithPackagesFromUsePackage, emacs29-pgtk, python3, texliveFull, makeWrapper, lib }:
let
emacs-linux = emacsWithPackagesFromUsePackage {
package = emacs29-pgtk;
config = ./config.org;
defaultInitFile = true;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages =
e: (builtins.attrValues {
inherit (e)
nix-ts-mode
base16-theme
vertico
orderless
marginalia
embark
consult
embark-consult
consult-dir
doom-modeline
flycheck
which-key
lsp-mode
lsp-ui
lsp-pyright
treemacs
lsp-treemacs
consult-lsp
treemacs-icons-dired
treemacs-nerd-icons
nerd-icons
all-the-icons
projectile
treemacs-projectile
magit
treemacs-magit
rustic
haskell-mode
envrc
ccls
org-roam
;
}) ++ [
e.treesit-grammars.with-all-grammars
python3
texliveTeTeX
];
override = _: prev: { use-package = prev.emacs; };
config = ./config.org;
defaultInitFile = true;
alwaysEnsure = true;
alwaysTangle = true;
extraEmacsPackages =
e: (builtins.attrValues {
inherit (e)
nix-ts-mode
base16-theme
vertico
orderless
marginalia
embark
consult
embark-consult
consult-dir
doom-modeline
flycheck
which-key
lsp-mode
lsp-ui
lsp-pyright
treemacs
lsp-treemacs
consult-lsp
treemacs-icons-dired
treemacs-nerd-icons
nerd-icons
all-the-icons
projectile
treemacs-projectile
magit
treemacs-magit
rustic
haskell-mode
envrc
ccls
org-roam
;
}) ++ [
e.treesit-grammars.with-all-grammars
python3
];
override = _: prev: { use-package = prev.emacs; };
};
in
symlinkJoin {
name = "emacs";
paths = [ texliveFull emacs-linux ];
buildInputs = [ makeWrapper ];
postBuild = ''
mkdir -p $out/bin
wrapProgram $out/bin/emacs \
--set PATH ${lib.makeBinPath [ texliveFull ]}:$PATH
'';
}