about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home-manager/config/lf/default.nix49
1 files changed, 16 insertions, 33 deletions
diff --git a/home-manager/config/lf/default.nix b/home-manager/config/lf/default.nix
index e64225b1..c7e59bb8 100644
--- a/home-manager/config/lf/default.nix
+++ b/home-manager/config/lf/default.nix
@@ -4,20 +4,24 @@
   sysLib,
   ...
 }: let
+  functionCall = {
+    file,
+    dependencies,
+    ...
+  }:
+    sysLib.makeShellScriptWithLibrary {
+      name = "${file}";
+      script = file;
+      inherit dependencies;
+    }
+    + "/bin/${file}";
   shell = {
     file,
     dependencies,
     ...
   }: ''
     ''${{
-    ${
-      builtins.readFile (sysLib.makeShellScriptWithLibrary {
-          name = "NAME_FOR_A_SHELL_SCRIPT";
-          script = file;
-          inherit dependencies;
-        }
-        + /bin/NAME_FOR_A_SHELL_SCRIPT)
-    }
+      exec ${functionCall {inherit file dependencies;}}
     }}
   ''; # closes the lf tui
   pipe = {
@@ -26,14 +30,7 @@
     ...
   }: ''
     %{{
-    ${
-      builtins.readFile (sysLib.makeShellScriptWithLibrary {
-          name = "NAME_FOR_A_SHELL_SCRIPT";
-          script = file;
-          inherit dependencies;
-        }
-        + /bin/NAME_FOR_A_SHELL_SCRIPT)
-    }
+      exec ${functionCall {inherit file dependencies;}}
     }}
   ''; # runs the command in the ui/term bar
   async = {
@@ -42,14 +39,7 @@
     ...
   }: ''
     &{{
-    ${
-      builtins.readFile (sysLib.makeShellScriptWithLibrary {
-          name = "NAME_FOR_A_SHELL_SCRIPT";
-          script = file;
-          inherit dependencies;
-        }
-        + /bin/NAME_FOR_A_SHELL_SCRIPT)
-    }
+      exec ${functionCall {inherit file dependencies;}}
     }}
   ''; # runs the command in the background
   wait = {
@@ -58,14 +48,7 @@
     ...
   }: ''
     !{{
-    ${
-      builtins.readFile (sysLib.makeShellScriptWithLibrary {
-          name = "NAME_FOR_A_SHELL_SCRIPT";
-          script = file;
-          inherit dependencies;
-        }
-        + /bin/NAME_FOR_A_SHELL_SCRIPT)
-    }
+      exec ${functionCall {inherit file dependencies;}}
     }}
   ''; # adds a prompt after the command has run
 in {
@@ -182,7 +165,7 @@ in {
             gnutar
             unzip
             # TODO this is unfree! unrar
-            
+
             p7zip
             ;
         };