blob: f2c81a2c0226c7eba582f20818228529dbfe7198 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{ pkgs, ... }:
{ name, src, deps ? (_: []), emacs ? pkgs.emacs26-nox }:
let
inherit (pkgs) emacsPackages emacsPackagesGen writeTextFile;
inherit (builtins) isString toFile;
finalEmacs = (emacsPackagesGen 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} $@
'';
}
|