7f8184c6b7
Change-Id: Ib9793da985128b4a8f64b04086ea89ce81118188 Reviewed-on: https://cl.tvl.fyi/c/depot/+/705 Tested-by: BuildkiteCI Reviewed-by: Kane York <rikingcoding@gmail.com> Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: BuildkiteCI
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} $@
|
|
''
|