diff options
Diffstat (limited to 'hm/soispha/conf/lf/commands/default.nix')
-rw-r--r-- | hm/soispha/conf/lf/commands/default.nix | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/hm/soispha/conf/lf/commands/default.nix b/hm/soispha/conf/lf/commands/default.nix index 14a160c6..1cb6996a 100644 --- a/hm/soispha/conf/lf/commands/default.nix +++ b/hm/soispha/conf/lf/commands/default.nix @@ -3,67 +3,66 @@ sysLib, shell_library, system, - lf_rename, ... }: let functionCall = { - file, + name, dependencies, replacementStrings, ... }: sysLib.writeShellScript { - name = "${builtins.baseNameOf file}"; - src = file; + inherit name; + src = ./scripts/${name}.sh; keepPath = true; dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash coreutils;}); inherit replacementStrings; } - + "/bin/${builtins.baseNameOf file}"; + + "/bin/${name}.sh"; shell = { - file, + name, dependencies, replacementStrings ? null, ... }: '' ''${{ - ${functionCall {inherit file dependencies replacementStrings;}} + ${functionCall {inherit name dependencies replacementStrings;}} }} ''; # closes the lf tui pipe = { - file, + name, dependencies, replacementStrings ? null, ... }: '' %{{ - ${functionCall {inherit file dependencies replacementStrings;}} + ${functionCall {inherit name dependencies replacementStrings;}} }} ''; # runs the command in the ui/term bar async = { - file, + name, dependencies, replacementStrings ? null, ... }: '' &{{ - ${functionCall {inherit file dependencies replacementStrings;}} + ${functionCall {inherit name dependencies replacementStrings;}} }} ''; # runs the command in the background wait = { - file, + name, dependencies, replacementStrings ? null, ... }: '' !{{ - ${functionCall {inherit file dependencies replacementStrings;}} + ${functionCall {inherit name dependencies replacementStrings;}} }} ''; # adds a prompt after the command has run in { archive = shell { - file = ./scripts/archive; + name = "archive"; dependencies = builtins.attrValues { inherit (pkgs) @@ -76,17 +75,17 @@ in { }; }; broot_jump = shell { - file = ./scripts/broot_jump; + name = "broot_jump"; dependencies = builtins.attrValues { inherit (pkgs) broot; }; }; chmod = pipe { - file = ./scripts/chmod; + name = "chmod"; dependencies = []; }; clear_trash = shell { - file = ./scripts/clear_trash; + name = "clear_trash"; dependencies = builtins.attrValues { inherit (pkgs) @@ -96,7 +95,7 @@ in { }; }; dl_file = pipe { - file = ./scripts/dl_file; + name = "dl_file"; dependencies = builtins.attrValues { inherit (pkgs) @@ -106,7 +105,7 @@ in { }; }; dragon = pipe { - file = ./scripts/dragon; + name = "dragon"; dependencies = builtins.attrValues { inherit (pkgs) @@ -115,7 +114,7 @@ in { }; }; dragon_individual = pipe { - file = ./scripts/dragon_individual; + name = "dragon_individual"; dependencies = builtins.attrValues { inherit (pkgs) @@ -124,7 +123,7 @@ in { }; }; dragon_stay = pipe { - file = ./scripts/dragon_stay; + name = "dragon_stay"; dependencies = builtins.attrValues { inherit (pkgs) @@ -133,36 +132,36 @@ in { }; }; fzf_jump = shell { - file = ./scripts/fzf_jump; + name = "fzf_jump"; dependencies = builtins.attrValues { inherit (pkgs) fzf lf gnused; }; }; mk_dir = pipe { - file = ./scripts/mk_dir; + name = "mk_dir"; dependencies = []; }; mk_file = shell { - file = ./scripts/mk_file; + name = "mk_file"; dependencies = []; }; mk_file_and_edit = shell { - file = ./scripts/mk_file_and_edit; + name = "mk_file_and_edit"; dependencies = []; }; mk_ln = pipe { - file = ./scripts/mk_ln; + name = "mk_ln"; dependencies = []; }; mk_scr_default = shell { - file = ./scripts/mk_scr_default; + name = "mk_scr_default"; dependencies = builtins.attrValues {}; replacementStrings = { SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; }; }; mk_scr_temp = shell { - file = ./scripts/mk_scr_temp; + name = "mk_scr_temp"; dependencies = builtins.attrValues {}; replacementStrings = { SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; @@ -170,15 +169,15 @@ in { }; }; open = shell { - file = ./scripts/open; + name = "open"; dependencies = builtins.attrValues {inherit (pkgs) file xdg-utils;}; }; go_project_base_directory = async { - file = ./scripts/go_project_root; + name = "go_project_root"; dependencies = []; }; open_config = shell { - file = ./scripts/open_config; + name = "open_config"; dependencies = builtins.attrValues { #inherit #(pkgs) @@ -189,7 +188,7 @@ in { }; }; restore_trash = shell { - file = ./scripts/restore_trash; + name = "restore_trash"; dependencies = builtins.attrValues { inherit (pkgs) @@ -199,7 +198,7 @@ in { }; }; set_wall_paper = pipe { - file = ./scripts/set_wall_paper; + name = "set_wall_paper"; dependencies = []; }; /* @@ -212,11 +211,11 @@ in { ''; */ stripspace = pipe { - file = ./scripts/stripspace; + name = "stripspace"; dependencies = []; }; trash = pipe { - file = ./scripts/trash; + name = "trash"; dependencies = builtins.attrValues { inherit (pkgs) @@ -227,14 +226,14 @@ in { }; }; unarchive = pipe { - file = ./scripts/unarchive; + name = "unarchive"; dependencies = builtins.attrValues { inherit (pkgs) gnutar unzip # TODO: this is unfree! unrar - + p7zip ; }; |