c4fb0432ae
GitOrigin-RevId: 3fc1143a04da49a92c3663813c6a0c1e8ccd477f
18 lines
437 B
Nix
18 lines
437 B
Nix
{ depot, pkgs, ... }:
|
|
|
|
{ name, src, deps ? (_: []), emacs ? pkgs.emacs26-nox }:
|
|
|
|
let
|
|
inherit (pkgs) emacsPackages emacsPackagesGen;
|
|
inherit (builtins) isString toFile;
|
|
|
|
finalEmacs = (emacsPackagesGen 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} $@
|
|
''
|