aboutsummaryrefslogtreecommitdiff
path: root/home-manager/programs/fish/default.nix
blob: 88bfe3b63f867e78728dfa0aea550848332bc40e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ pkgs, ... }:

let
  nixPlugins = [
    { name = "colored-man-output"; src = pkgs.fishPlugins.colored-man-pages.src; }
    { name = "fzf-fish"; src = pkgs.fishPlugins.fzf-fish.src; }
    { name = "pure"; src = pkgs.fishPlugins.pure.src; }
    { name = "autopair"; src = pkgs.fishPlugins.autopair.src; }
  ];
  customPlugins = [];
  plugins = nixPlugins ++ customPlugins;
  interactiveShellInit = ''
    set fish_greeting
    pokemon-colorscripts -r --no-title
  '';
  # loginShellInit = ''
  #   Hyprland
  # '';
  functions = {
    ranger_func = ''
      ranger $argv
      set -l quit_cd_wd_file "$HOME/.ranger_quit_cd_wd"
      if test -s "$quit_cd_wd_file"
        cd "$(cat $quit_cd_wd_file)"
        true > "$quit_cd_wd_file"
      end
    '';
  };
  shellAliases = {
    rn = "ranger_func";
    ls = "ls --hyperlink=auto --color=auto";
    iamatomic = "sudo nixos-rebuild switch --flake ~/.nixfiles#ltrr";
  };
      
in
{
  programs.direnv = {
    enable = true;
  };
  
  programs.fish = {
    enable = true;
    inherit plugins interactiveShellInit  functions shellAliases;
  };
}