Skip to content

Commit 821d07e

Browse files
committed
add args to shell functions and programs fish
1 parent 62f91c1 commit 821d07e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

nix/shell-plugins.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,22 @@ in {
7474
# where `{pkg}` is the executable name of the package
7575
posixFunctions = map (package: ''
7676
${package}() {
77-
op plugin run -- ${package};
77+
op plugin run -- ${package} "$@";
7878
}
7979
'') pkg-exe-names;
8080
fishFunctions = map (package: ''
8181
function ${package} --wraps "${package}" --description "1Password Shell Plugin for ${package}"
82-
op plugin run -- ${package}
82+
op plugin run -- ${package} $argv
8383
end
8484
'') pkg-exe-names;
8585
packages = lib.optional (cfg.package != null) cfg.package ++ cfg.plugins;
8686
in mkIf cfg.enable (mkMerge [
87-
({
88-
# for Fish its the same option path between NixOS vs. home-manager
89-
fish.interactiveShellInit = strings.concatStringsSep "\n" fishFunctions;
90-
} // optionalAttrs is-home-manager {
87+
(
88+
optionalAttrs is-home-manager {
9189
programs = {
9290
# for the Bash and Zsh home-manager modules,
9391
# the initExtra option is equivalent to Fish's interactiveShellInit
92+
fish.interactiveShellInit = strings.concatStringsSep "\n" fishFunctions;
9493
bash.initExtra = strings.concatStringsSep "\n" posixFunctions;
9594
zsh.initExtra = strings.concatStringsSep "\n" posixFunctions;
9695
};

0 commit comments

Comments
 (0)