2020-06-28 05:01:29 +02:00
|
|
|
{ depot, pkgs, ... }:
|
2019-12-09 03:20:02 +01:00
|
|
|
|
2020-12-01 13:16:56 +01:00
|
|
|
{ name, src, deps ? (_: []), emacs ? pkgs.emacs27-nox }:
|
2019-12-09 03:20:02 +01:00
|
|
|
|
|
|
|
let
|
2020-06-28 05:01:29 +02:00
|
|
|
inherit (pkgs) emacsPackages emacsPackagesGen;
|
2019-12-09 03:20:02 +01:00
|
|
|
inherit (builtins) isString toFile;
|
|
|
|
|
2020-03-09 00:17:01 +01:00
|
|
|
finalEmacs = (emacsPackagesGen emacs).emacsWithPackages deps;
|
2019-12-09 03:20:02 +01:00
|
|
|
|
|
|
|
srcFile = if isString src
|
|
|
|
then toFile "${name}.el" src
|
|
|
|
else src;
|
|
|
|
|
2020-06-28 05:01:29 +02:00
|
|
|
in depot.nix.writeScriptBin name ''
|
|
|
|
#!/bin/sh
|
|
|
|
${finalEmacs}/bin/emacs --batch --no-site-file --script ${srcFile} $@
|
|
|
|
''
|