My NixOS configuration (mirror)
1{
2 config,
3 lib,
4 pkgs,
5 ...
6}: {
7 options.home.shell.fish = {
8 enable = lib.mkEnableOption "fish shell configuration";
9 };
10
11 config = lib.mkIf config.home.shell.fish.enable {
12 programs.fish = {
13 enable = true;
14 interactiveShellInit = ''
15 set fish_greeting
16 set --universal pure_enable_nixdevshell true
17 set --universal pure_symbol_nixdevshell_prefix " "
18
19 # https://github.com/NixOS/nixpkgs/issues/462025
20 set -p fish_complete_path ${pkgs.fish}/share/fish/completions
21
22 function _pure_prompt_nixdevshell \
23 --description "Indicate if nix develop shell is activated (icon only)"
24
25 if set --query pure_enable_nixdevshell;
26 and test "$pure_enable_nixdevshell" = true;
27 and test -n "$IN_NIX_SHELL"
28
29 set --local prefix (_pure_set_color $pure_color_nixdevshell_prefix)$pure_symbol_nixdevshell_prefix
30 set --local symbol (_pure_set_color $pure_color_nixdevshell_status)
31
32 echo "$prefix$symbol"
33 end
34 end
35
36 function copyfile
37 cat $argv | wl-copy
38 end
39
40 zoxide init fish | source
41 tv init fish | source
42 '';
43 shellAliases = {
44 ls = "eza -la --octal-permissions --git";
45 cat = "bat";
46 grep = "grep -n --color";
47 mkdir = "mkdir -pv";
48 lg = "lazygit";
49 ".." = "cd ..";
50 ":q" = "exit";
51 find = "fd";
52 };
53 plugins = [
54 {
55 name = "pure";
56 src = pkgs.fishPlugins.pure.src;
57 }
58 ];
59 };
60
61 programs.zoxide = {
62 enable = true;
63 enableZshIntegration = true;
64 };
65 };
66}