2025-10-04 11:28:55 +08:00
|
|
|
{
|
|
|
|
|
inputs,
|
|
|
|
|
system,
|
|
|
|
|
editor-runtime,
|
|
|
|
|
symlinkJoin,
|
|
|
|
|
makeWrapper,
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
inherit (inputs) nixpkgs emacs-overlay nix-doom;
|
|
|
|
|
pkgs = import nixpkgs {
|
2025-10-18 23:10:53 +08:00
|
|
|
localSystem = { inherit system; };
|
2025-10-04 11:28:55 +08:00
|
|
|
overlays = [
|
|
|
|
|
emacs-overlay.overlays.default
|
|
|
|
|
nix-doom.overlays.default
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
emacs = pkgs.emacs-igc-pgtk;
|
|
|
|
|
doom-emacs = pkgs.doomEmacs {
|
|
|
|
|
doomDir = ./config;
|
|
|
|
|
doomLocalDir = "~/.local/share/nix-doom";
|
|
|
|
|
emacs = emacs;
|
|
|
|
|
extraPackages =
|
|
|
|
|
ep: with ep; [
|
|
|
|
|
melpaPackages.telega
|
|
|
|
|
melpaPackages.nixos-options
|
|
|
|
|
melpaPackages.scroll-on-jump
|
2025-10-04 11:28:55 +08:00
|
|
|
melpaPackages.org-modern
|
2025-10-04 11:28:55 +08:00
|
|
|
];
|
|
|
|
|
extraBinPackages =
|
|
|
|
|
(with pkgs; [
|
|
|
|
|
git
|
|
|
|
|
ripgrep
|
|
|
|
|
fd
|
|
|
|
|
imagemagick
|
|
|
|
|
])
|
|
|
|
|
++ [ editor-runtime ];
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
symlinkJoin {
|
|
|
|
|
name = "doom-emacs";
|
|
|
|
|
paths = [ doom-emacs ];
|
|
|
|
|
inherit (doom-emacs) meta;
|
|
|
|
|
buildInputs = [
|
|
|
|
|
makeWrapper
|
|
|
|
|
];
|
|
|
|
|
env = {
|
|
|
|
|
ORIGINAL_EMACS = toString emacs;
|
|
|
|
|
};
|
|
|
|
|
postBuild = ''
|
|
|
|
|
wrapProgram $out/bin/doom-emacs \
|
|
|
|
|
--unset EMACSNATIVELOADPATH \
|
|
|
|
|
--unset EMACSLOADPATH \
|
|
|
|
|
--inherit-argv0
|
|
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
|
cp ''${ORIGINAL_EMACS}/share/applications/emacs.desktop \
|
|
|
|
|
$out/share/applications/doom-emacs.desktop
|
|
|
|
|
cp -rt $out/share ''${ORIGINAL_EMACS}/share/icons
|
|
|
|
|
substituteInPlace $out/share/applications/doom-emacs.desktop \
|
|
|
|
|
--replace 'Name=Emacs' 'Name=Doom Emacs' \
|
|
|
|
|
--replace 'Exec=emacs' "Exec=$out/bin/doom-emacs" \
|
|
|
|
|
--replace 'StartupWMClass=Emacs' "StartupWMClass=Doom Emacs"
|
|
|
|
|
'';
|
|
|
|
|
}
|