From 87f1e15baa5491dcfd1b66102909d1ba1b75c175 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 1 Dec 2020 13:16:56 +0100 Subject: chore(writeElispBin): Move from //overrides to //nix ... some legacy cleanup ... Change-Id: I9e73451256f842e75ddbf1382badaf06c775c755 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2212 Tested-by: BuildkiteCI Reviewed-by: tazjin --- nix/writeElispBin/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 nix/writeElispBin/default.nix (limited to 'nix') diff --git a/nix/writeElispBin/default.nix b/nix/writeElispBin/default.nix new file mode 100644 index 000000000000..c116607e0aeb --- /dev/null +++ b/nix/writeElispBin/default.nix @@ -0,0 +1,18 @@ +{ depot, pkgs, ... }: + +{ name, src, deps ? (_: []), emacs ? pkgs.emacs27-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} $@ +'' -- cgit 1.4.1