fish module

main
Zynh Ludwig 2024-05-29 21:54:42 -07:00
parent 1e87bd7221
commit 1e7079e54c
3 changed files with 28 additions and 18 deletions

View File

@ -4,7 +4,6 @@
imports = [ imports = [
./home/modules ./home/modules
./home/modules/git.nix ./home/modules/git.nix
./home/modules/fish.nix
]; ];
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should

View File

@ -1,7 +1,10 @@
{ ... }: { lib, ... }:
{ {
imports = [ imports = [
./neovim.nix ./neovim.nix
./alacritty.nix ./alacritty.nix
./fish.nix
]; ];
snowhawk.fish.enable = lib.mkDefault true;
} }

View File

@ -1,21 +1,29 @@
{ pkgs, inputs, ... }: { pkgs, inputs, config, lib, ... }:
let
cfg = config.snowhawk.fish;
in
{ {
programs.bash = { options.snowhawk.fish = {
enable = true; enable = lib.mkEnableOption "fish";
initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
}; };
config = lib.mkIf cfg.enable {
programs.bash = {
enable = true;
initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
programs.fish = { programs.fish = {
enable = true; enable = true;
interactiveShellInit = interactiveShellInit =
builtins.readFile "${inputs.fish_theme}/fish_prompt.fish" + "\n" + builtins.readFile "${inputs.fish_theme}/fish_prompt.fish" + "\n" +
builtins.readFile ../fish/config.fish builtins.readFile ../fish/config.fish
; ;
};
}; };
} }