diff --git a/hmModules/apps/file-browsers/lf/default.nix b/hmModules/apps/file-browsers/lf/default.nix index 0ad6060..f4ff3da 100644 --- a/hmModules/apps/file-browsers/lf/default.nix +++ b/hmModules/apps/file-browsers/lf/default.nix @@ -10,6 +10,13 @@ config = lib.mkIf config.lf.enable { xdg.configFile."lf/icons".source = ./icons; + fish.extraFunctions = lib.mkIf config.fish.enable { + lf = { + body = ''cd "$(command ${pkgs.lf}/bin/lf -print-last-dir "$argv")"''; + wraps = "${pkgs.lf}/bin/lf"; + }; + }; + programs.lf = { enable = true; settings = { diff --git a/hmModules/apps/shells/fish/default.nix b/hmModules/apps/shells/fish/default.nix index 0390a09..0fc1e53 100644 --- a/hmModules/apps/shells/fish/default.nix +++ b/hmModules/apps/shells/fish/default.nix @@ -1,10 +1,19 @@ { config, pkgs, lib, ... }: - -{ +let + functionModule = with lib.types; submodule { + options = { + body = lib.mkOption { type = lines; }; + wraps = lib.mkOption { + type = nullOr str; + default = null; + }; + }; + }; +in { options.fish = { enable = lib.mkEnableOption "Enables fish"; extraFunctions = lib.mkOption { - type = with lib.types; attrsOf lines; + type = with lib.types; attrsOf (either lines functionModule); default = {}; }; };