diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-18 21:56:16 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-18 21:59:59 +0200 |
commit | 746ea42ff4616024ec41b6dcb1d2588dee4b85d1 (patch) | |
tree | 4d4a1a774f6499161f7bd3077f1f21c31f93da35 /modules/home.legacy/conf/lf/commands/default.nix | |
parent | refactor(modules/legacy/conf/zsh): Parameterize and move to new `by-name` (diff) | |
download | nixos-config-746ea42ff4616024ec41b6dcb1d2588dee4b85d1.tar.gz nixos-config-746ea42ff4616024ec41b6dcb1d2588dee4b85d1.zip |
refactor(modules/legacy/conf/lf): Move to new `by-name` dir
This makes it possible to mix and match between `NixOS` and `home-manager` options and thus allows merging the secret handling directly into this module. Furthermore, the `systemd` tempfiles handling was also merged into this module.
Diffstat (limited to 'modules/home.legacy/conf/lf/commands/default.nix')
-rw-r--r-- | modules/home.legacy/conf/lf/commands/default.nix | 227 |
1 files changed, 0 insertions, 227 deletions
diff --git a/modules/home.legacy/conf/lf/commands/default.nix b/modules/home.legacy/conf/lf/commands/default.nix deleted file mode 100644 index 933769ac..00000000 --- a/modules/home.legacy/conf/lf/commands/default.nix +++ /dev/null @@ -1,227 +0,0 @@ -{ - pkgs, - sysLib, - shell_library, - system, - ... -}: let - functionCall = { - name, - dependencies, - replacementStrings, - ... - }: - sysLib.writeShellScript { - inherit name; - src = ./scripts/${name}.sh; - keepPath = true; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash coreutils;}); - inherit replacementStrings; - } - + "/bin/${name}"; - - shell = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' - ''${{ - ${functionCall {inherit name dependencies replacementStrings;}} - }} - ''; # closes the lf tui - pipe = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' - %{{ - ${functionCall {inherit name dependencies replacementStrings;}} - }} - ''; # runs the command in the ui/term bar - async = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' - &{{ - ${functionCall {inherit name dependencies replacementStrings;}} - }} - ''; # runs the command in the background - wait = { - name, - dependencies, - replacementStrings ? null, - ... - }: '' - !{{ - ${functionCall {inherit name dependencies replacementStrings;}} - }} - ''; # adds a prompt after the command has run -in { - archive = shell { - name = "archive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - gnutar - xz - p7zip - zip - ; - }; - }; - broot_jump = shell { - name = "broot_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) broot; - }; - }; - chmod = pipe { - name = "chmod"; - dependencies = []; - }; - clear_trash = shell { - name = "clear_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; - dl_file = pipe { - name = "dl_file"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - curl - ; - }; - }; - dragon = pipe { - name = "dragon"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; - }; - dragon_individual = pipe { - name = "dragon_individual"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; - }; - dragon_stay = pipe { - name = "dragon_stay"; - dependencies = builtins.attrValues { - inherit - (pkgs) - xdragon - ; - }; - }; - execute = shell { - name = "execute"; - dependencies = []; - }; - follow_link = pipe { - name = "follow_link"; - dependencies = with pkgs; [lf]; - }; - fzf_jump = shell { - name = "fzf_jump"; - dependencies = builtins.attrValues { - inherit (pkgs) fzf lf gnused; - }; - }; - mk_dir = pipe { - name = "mk_dir"; - dependencies = []; - }; - mk_file = shell { - name = "mk_file"; - dependencies = []; - }; - mk_file_and_edit = shell { - name = "mk_file_and_edit"; - dependencies = []; - }; - mk_ln = pipe { - name = "mk_ln"; - dependencies = []; - }; - mk_scr_default = shell { - name = "mk_scr_default"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - }; - }; - mk_scr_temp = shell { - name = "mk_scr_temp"; - dependencies = builtins.attrValues {}; - replacementStrings = { - SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; - TO_BE_SHELL_LIBRARY_PATH = "%SHELL_LIBRARY_PATH"; # replacement is not recursive - }; - }; - view_file = async { - name = "view_file"; - dependencies = builtins.attrValues {inherit (pkgs) file;}; - }; - go_project_base_directory = async { - name = "go_project_root"; - dependencies = []; - }; - restore_trash = shell { - name = "restore_trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - fzf - trashy - ; - }; - }; - set_wall_paper = pipe { - name = "set_wall_paper"; - dependencies = []; - }; - stripspace = pipe { - name = "stripspace"; - dependencies = []; - }; - trash = pipe { - name = "trash"; - dependencies = builtins.attrValues { - inherit - (pkgs) - trashy - trash-cli - findutils - ; - }; - }; - unarchive = pipe { - name = "unarchive"; - dependencies = builtins.attrValues { - inherit - (pkgs) - gnutar - unzip - p7zip - ; - }; - }; -} |