From 8de5d093d8e35b2492c81015dcfcb052d2718614 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 20 Dec 2019 20:37:02 +0000 Subject: refactor: Fix a variety of filepaths for repo relayouting This fixes readTree and the various project builds, as well as (hopefully) most documentation links inside of the projects. --- overrides/writeElispBin/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 overrides/writeElispBin/default.nix (limited to 'overrides/writeElispBin/default.nix') diff --git a/overrides/writeElispBin/default.nix b/overrides/writeElispBin/default.nix new file mode 100644 index 0000000000..a1616fb9d4 --- /dev/null +++ b/overrides/writeElispBin/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: + +{ name, src, deps ? (_: []), emacs ? pkgs.third_party.emacs26-nox }: + +let + inherit (pkgs.third_party) emacsPackagesNg emacsPackagesNgGen writeTextFile; + inherit (builtins) isString toFile; + + finalEmacs = (emacsPackagesNgGen 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} $@ + ''; +} -- cgit 1.4.1