about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/profpatsch/execline')
-rw-r--r--pkgs/profpatsch/execline/nixecline.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/profpatsch/execline/nixecline.nix b/pkgs/profpatsch/execline/nixecline.nix
new file mode 100644
index 00000000..518bce2e
--- /dev/null
+++ b/pkgs/profpatsch/execline/nixecline.nix
@@ -0,0 +1,16 @@
+# wrappers around execline commands ensuring sane default behaviours
+{ writeExecline }:
+
+let
+  backtick = {
+    var,
+    cmd,
+    importVar ? [ "importas" "-ui" var var ]
+  }: writeExecline "nix-backtick" {}
+    ([ "backtick" "-in" var cmd ]
+    ++ importVar
+    ++ [ "$@" ]);
+
+in {
+ inherit backtick;
+}