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