Loading nixos/modules/programs/fish.nix +12 −12 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ }: let cfge = config.environment; cfg = config.programs.fish; Loading @@ -27,6 +26,14 @@ let envInteractiveShellInit = pkgs.writeText "interactiveShellInit" cfge.interactiveShellInit; indentFishFile = name: text: pkgs.runCommand name { nativeBuildInputs = [ cfg.package ]; inherit text; passAsFile = [ "text" ]; } "fish_indent < $textPath > $out"; sourceEnv = file: if cfg.useBabelfish then Loading @@ -46,13 +53,9 @@ let } "babelfish < ${path} > $out;"; in { options = { programs.fish = { enable = lib.mkOption { default = false; description = '' Loading Loading @@ -153,13 +156,10 @@ in ''; type = lib.types.lines; }; }; }; config = lib.mkIf cfg.enable { programs.fish.shellAliases = lib.mapAttrs (name: lib.mkDefault) cfge.shellAliases; # Required for man completions Loading @@ -182,16 +182,16 @@ in }) { etc."fish/nixos-env-preinit.fish".text = etc."fish/nixos-env-preinit.fish".source = if cfg.useBabelfish then '' indentFishFile "nixos-env-preinit.fish" '' # source the NixOS environment config if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ] source /etc/fish/setEnvironment.fish end '' else '' indentFishFile "nixos-env-preinit.fish" '' # This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently # unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish set fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d $__fish_datadir/functions Loading @@ -207,7 +207,7 @@ in } { etc."fish/config.fish".text = '' etc."fish/config.fish".source = indentFishFile "config.fish" '' # /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically. # if we haven't sourced the general config, do it Loading nixos/tests/fish.nix +2 −0 Original line number Diff line number Diff line Loading @@ -24,5 +24,7 @@ machine.succeed( "fish -ic 'echo $fish_complete_path' | grep -q '/share/fish/vendor_completions.d /etc/fish/generated_completions /root/.cache/fish/generated_completions$'" ) machine.wait_for_file("/etc/fish/config.fish") config = machine.succeed("fish_indent -c /etc/fish/config.fish") ''; } Loading
nixos/modules/programs/fish.nix +12 −12 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ }: let cfge = config.environment; cfg = config.programs.fish; Loading @@ -27,6 +26,14 @@ let envInteractiveShellInit = pkgs.writeText "interactiveShellInit" cfge.interactiveShellInit; indentFishFile = name: text: pkgs.runCommand name { nativeBuildInputs = [ cfg.package ]; inherit text; passAsFile = [ "text" ]; } "fish_indent < $textPath > $out"; sourceEnv = file: if cfg.useBabelfish then Loading @@ -46,13 +53,9 @@ let } "babelfish < ${path} > $out;"; in { options = { programs.fish = { enable = lib.mkOption { default = false; description = '' Loading Loading @@ -153,13 +156,10 @@ in ''; type = lib.types.lines; }; }; }; config = lib.mkIf cfg.enable { programs.fish.shellAliases = lib.mapAttrs (name: lib.mkDefault) cfge.shellAliases; # Required for man completions Loading @@ -182,16 +182,16 @@ in }) { etc."fish/nixos-env-preinit.fish".text = etc."fish/nixos-env-preinit.fish".source = if cfg.useBabelfish then '' indentFishFile "nixos-env-preinit.fish" '' # source the NixOS environment config if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ] source /etc/fish/setEnvironment.fish end '' else '' indentFishFile "nixos-env-preinit.fish" '' # This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently # unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish set fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d $__fish_datadir/functions Loading @@ -207,7 +207,7 @@ in } { etc."fish/config.fish".text = '' etc."fish/config.fish".source = indentFishFile "config.fish" '' # /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically. # if we haven't sourced the general config, do it Loading
nixos/tests/fish.nix +2 −0 Original line number Diff line number Diff line Loading @@ -24,5 +24,7 @@ machine.succeed( "fish -ic 'echo $fish_complete_path' | grep -q '/share/fish/vendor_completions.d /etc/fish/generated_completions /root/.cache/fish/generated_completions$'" ) machine.wait_for_file("/etc/fish/config.fish") config = machine.succeed("fish_indent -c /etc/fish/config.fish") ''; }