about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2019-10-02 00:20:54 +0200
committerProfpatsch <mail@profpatsch.de>2019-10-02 00:23:03 +0200
commit6043fbc005dc7ce810cacca6393ff469a6b75604 (patch)
tree59ed8964fd668f0b36a4cf5063755579ff5e199d
parentdfe0819ab760c4ef8b9095b29a2b5af3c396924d (diff)
pkgs/profpatsch: getBins
A simple way to reference binary paths in an attribute set without
string interpolations everywhere.
-rw-r--r--pkgs/profpatsch/default.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/profpatsch/default.nix b/pkgs/profpatsch/default.nix
index dc746c2e..b697bd75 100644
--- a/pkgs/profpatsch/default.nix
+++ b/pkgs/profpatsch/default.nix
@@ -33,7 +33,7 @@ let
   # and returns an attribute set of `name -> path`.
   # The list can also contain renames in the form of
   # { use, as }, which goes `as -> usePath`.
-  bins = drv: xs:
+  getBins = drv: xs:
     let f = x:
       # TODO: typecheck
       let x' = if builtins.isString x then { use = x; as = x; } else x;
@@ -64,15 +64,15 @@ let
     inherit stdenv lib;
     inherit (runExeclineFns) runExecline;
     inherit (pkgs) runCommand;
-    bin = bins pkgs.s6PortableUtils [ "s6-touch" "s6-echo" ];
+    bin = getBins pkgs.s6PortableUtils [ "s6-touch" "s6-echo" ];
   };
 
   runExeclineFns =
     # todo: factor out calling tests
     let
       it = import ./execline/run-execline.nix {
-        bin = (bins execlineb-with-builtins [ "execlineb" ])
-           // (bins pkgs.execline [ "redirfd" "importas" "exec" ]);
+        bin = (getBins execlineb-with-builtins [ "execlineb" ])
+           // (getBins pkgs.execline [ "redirfd" "importas" "exec" ]);
         inherit stdenv lib;
       };
       itLocal = name: args: execline:
@@ -91,12 +91,12 @@ let
         inherit (testing) drvSeqL;
         inherit (pkgs) coreutils;
         inherit stdenv;
-        bin = (bins execlineb-with-builtins [ "execlineb" ])
-           // (bins pkgs.execline [
+        bin = (getBins execlineb-with-builtins [ "execlineb" ])
+           // (getBins pkgs.execline [
                  { use = "if"; as = "execlineIf"; }
                  "redirfd" "importas"
                ])
-           // (bins pkgs.s6PortableUtils
+           // (getBins pkgs.s6PortableUtils
                 [ "s6-cat" "s6-grep" "s6-touch" "s6-test" "s6-chmod" ]);
        };
     in {
@@ -154,6 +154,8 @@ in rec {
   inherit (runExeclineFns)
     runExecline runExeclineLocal;
 
+  inherit getBins;
+
   symlink = pkgs.callPackage ./execline/symlink.nix {
     inherit runExecline;
   };