about summary refs log tree commit diff
path: root/pkgs/profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2019-12-08 15:06:59 +0100
committerProfpatsch <mail@profpatsch.de>2019-12-08 15:09:33 +0100
commit6cd157f0133bcd074ff947f3e5397f0e8cdc2830 (patch)
tree4352a8b2f2be4cc508cdae672af8a679e98bb6f0 /pkgs/profpatsch
parentd4097ecdd5af72b803b622d0139095dacd9a3bdd (diff)
machines/profpatsch,pkgs/profpatsch: rm `execlineb-with-builtins`
This has been upstreamed to nixpkgs proper, as a C wrapper script, in
https://github.com/NixOS/nixpkgs/pull/71357

So we don’t even need bash to run execline anymore :P
Diffstat (limited to 'pkgs/profpatsch')
-rw-r--r--pkgs/profpatsch/default.nix35
-rw-r--r--pkgs/profpatsch/execline/write-execline.nix4
2 files changed, 6 insertions, 33 deletions
diff --git a/pkgs/profpatsch/default.nix b/pkgs/profpatsch/default.nix
index d973b63e..f484c2ad 100644
--- a/pkgs/profpatsch/default.nix
+++ b/pkgs/profpatsch/default.nix
@@ -3,32 +3,6 @@
 let
   inherit (pkgs) callPackage;
 
-  # wrapper for execlineb that doesn’t need the execline commands
-  # in PATH to work (making them appear like “builtins”)
-  # TODO: upstream into nixpkgs
-  # TODO: the grep could be nicer
-  execlineb-with-builtins =
-    let eldir = "${pkgs.execline}/bin";
-    in pkgs.writeScriptBin "execlineb" ''
-      #!${eldir}/execlineb -s0
-      # appends the execlineb bin dir to PATH if not yet in PATH
-      ${eldir}/define eldir ${eldir}
-      ''${eldir}/ifelse
-      {
-        # since this is nix, we can grep for the execline drv hash in PATH
-        # to see whether it’s already in there
-        ''${eldir}/pipeline
-        { ${pkgs.coreutils}/bin/printenv PATH }
-        ${pkgs.gnugrep}/bin/grep --quiet "${eldir}"
-      }
-      # it’s there already
-      { ''${eldir}/execlineb $@ }
-      # not there yet, add it
-      ''${eldir}/importas oldpath PATH
-      ''${eldir}/export PATH "''${eldir}:''${oldpath}"
-      ''${eldir}/execlineb $@
-    '';
-
   # Takes a derivation and a list of binary names
   # and returns an attribute set of `name -> path`.
   # The list can also contain renames in the form of
@@ -65,8 +39,7 @@ let
     # todo: factor out calling tests
     let
       it = import ./execline/run-execline.nix {
-        bin = (getBins execlineb-with-builtins [ "execlineb" ])
-           // (getBins pkgs.execline [ "redirfd" "importas" "exec" ]);
+        bin = getBins pkgs.execline [ "execlineb" "redirfd" "importas" "exec" ];
         inherit stdenv lib;
       };
       itLocal = name: args: execline:
@@ -85,8 +58,8 @@ let
         inherit (testing) drvSeqL;
         inherit (pkgs) coreutils;
         inherit stdenv;
-        bin = (getBins execlineb-with-builtins [ "execlineb" ])
-           // (getBins pkgs.execline [
+        bin = (getBins pkgs.execline [
+                 "execlineb"
                  { use = "if"; as = "execlineIf"; }
                  "redirfd" "importas"
                ])
@@ -100,7 +73,7 @@ let
     };
 
   writeExeclineFns = import ./execline/write-execline.nix {
-    inherit pkgs execlineb-with-builtins;
+    inherit pkgs;
   };
 
 
diff --git a/pkgs/profpatsch/execline/write-execline.nix b/pkgs/profpatsch/execline/write-execline.nix
index c2128ea3..f83aa2ed 100644
--- a/pkgs/profpatsch/execline/write-execline.nix
+++ b/pkgs/profpatsch/execline/write-execline.nix
@@ -1,4 +1,4 @@
-{ pkgs, execlineb-with-builtins }:
+{ pkgs }:
 let
   escape = import ./escape.nix { inherit (pkgs) lib; };
 
@@ -6,7 +6,7 @@ let
   # Everything is escaped correctly.
   # TODO upstream into nixpkgs
   writeExeclineCommon = writer: name: { readNArgs ? 0 }: argList: writer name ''
-    #!${execlineb-with-builtins}/bin/execlineb -Ws${toString readNArgs}
+    #!${pkgs.execline}/bin/execlineb -Ws${toString readNArgs}
     ${escape.escapeExecline argList}
   '';
   writeExecline = writeExeclineCommon pkgs.writeScript;