refactor(overrides/writeElispBin): use writeScriptBin

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
This commit is contained in:
Profpatsch 2020-06-28 05:01:29 +02:00
parent 2f21e0c8c0
commit 7f8184c6b7
2 changed files with 6 additions and 12 deletions

View file

@ -1,9 +1,9 @@
{ pkgs, ... }:
{ depot, pkgs, ... }:
{ name, src, deps ? (_: []), emacs ? pkgs.emacs26-nox }:
let
inherit (pkgs) emacsPackages emacsPackagesGen writeTextFile;
inherit (pkgs) emacsPackages emacsPackagesGen;
inherit (builtins) isString toFile;
finalEmacs = (emacsPackagesGen emacs).emacsWithPackages deps;
@ -11,13 +11,8 @@ let
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} $@
'';
}
in depot.nix.writeScriptBin name ''
#!/bin/sh
${finalEmacs}/bin/emacs --batch --no-site-file --script ${srcFile} $@
''

View file

@ -135,7 +135,6 @@ let
writeShellScript
writeShellScriptBin
writeText
writeTextFile
xorg
xz
zlib