From 7f8184c6b77c0912efad2f08beb64fab068f891f Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 28 Jun 2020 05:01:29 +0200 Subject: [PATCH] refactor(overrides/writeElispBin): use writeScriptBin Change-Id: Ib9793da985128b4a8f64b04086ea89ce81118188 Reviewed-on: https://cl.tvl.fyi/c/depot/+/705 Tested-by: BuildkiteCI Reviewed-by: Kane York Reviewed-by: tazjin Reviewed-by: BuildkiteCI --- overrides/writeElispBin/default.nix | 17 ++++++----------- third_party/default.nix | 1 - 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/overrides/writeElispBin/default.nix b/overrides/writeElispBin/default.nix index f2c81a2c0..1b3ba0544 100644 --- a/overrides/writeElispBin/default.nix +++ b/overrides/writeElispBin/default.nix @@ -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} $@ +'' diff --git a/third_party/default.nix b/third_party/default.nix index 042b5d583..0a9217ee7 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -135,7 +135,6 @@ let writeShellScript writeShellScriptBin writeText - writeTextFile xorg xz zlib