tvl-depot/nix/writeElispBin/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
442 B
Nix
Raw Permalink Normal View History

{ depot, pkgs, ... }:
{ name, src, deps ? (_: [ ]), emacs ? pkgs.emacs28-nox }:
let
inherit (pkgs) emacsPackages emacsPackagesFor;
inherit (builtins) isString toFile;
finalEmacs = (emacsPackagesFor emacs).emacsWithPackages deps;
srcFile =
if isString src
then toFile "${name}.el" src
else src;
in
depot.nix.writeScriptBin name ''
#!/bin/sh
${finalEmacs}/bin/emacs --batch --no-site-file --script ${srcFile} $@
''