tvl-depot/overrides/writeElispBin.nix
Vincent Ambo bd7c9e4b5a fix(writeElispBin): Use emacsPackagesNg
Ng is used by my Emacs derivation. I don't actually know what they do
differently, but it seems sensible to use the same one in both places.
2019-12-14 12:49:18 +00:00

23 lines
547 B
Nix

{ pkgs, ... }:
{ name, src, deps ? (_: []), emacs ? pkgs.third_party.emacs26-nox }:
let
inherit (pkgs.third_party) emacsPackagesNg emacsPackagesNgGen writeTextFile;
inherit (builtins) isString toFile;
finalEmacs = (emacsPackagesNgGen emacs).emacsWithPackages deps;
srcFile = if isString src
then toFile "${name}.el" src
else src;
in writeTextFile {
inherit name;
executable = true;
destination = "/bin/${name}";
text = ''
#!/bin/sh
${finalEmacs}/bin/emacs --batch --no-site-file --script ${srcFile} $@
'';
}