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 ++++++++++++++++++ overrides/writeElispBin/default.nix | 18 ------------------ users/tazjin/aoc2019/default.nix | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 nix/writeElispBin/default.nix delete mode 100644 overrides/writeElispBin/default.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} $@ +'' diff --git a/overrides/writeElispBin/default.nix b/overrides/writeElispBin/default.nix deleted file mode 100644 index 1b3ba054430b..000000000000 --- a/overrides/writeElispBin/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ 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} $@ -'' diff --git a/users/tazjin/aoc2019/default.nix b/users/tazjin/aoc2019/default.nix index 5f1f248c504a..ce3146d1f74e 100644 --- a/users/tazjin/aoc2019/default.nix +++ b/users/tazjin/aoc2019/default.nix @@ -13,7 +13,7 @@ let solutionFiles = filter (e: dir."${e}" == "regular" && isSolution e) (attrNames dir); solutions = map (f: let day = getDay f; in { name = day; - value = depot.writeElispBin { # TODO(tazjin): move writeElispBin to depot.nix + value = depot.nix.writeElispBin { name = "aoc2019"; deps = p: with p; [ dash s ht ]; src = ./. + ("/" + f); -- cgit 1.4.1