diff --git a/modules/shell.nix b/modules/shell.nix index 91cbc83..2d0a94c 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -4,6 +4,8 @@ programs.zsh.enable = true; programs.zsh.promptInit = ( builtins.readFile ../stow/.zshrc ); + programs.fish.enable = true; + environment.systemPackages = with pkgs; [ neovim git @@ -26,6 +28,8 @@ ffmpeg imagemagick + ] ++ lib.optionals config.programs.fish.enable [ + pkgs.fishPlugins.pure ] ++ lib.optionals pkgs.stdenv.isLinux [ pkgs.trash-cli ]; programs.tmux.enable = true; diff --git a/modules/users/nico.nix b/modules/users/nico.nix index bbe4da7..317b762 100644 --- a/modules/users/nico.nix +++ b/modules/users/nico.nix @@ -4,7 +4,7 @@ users.users.nico = { isNormalUser = true; extraGroups = [ "wheel" ]; - shell = pkgs.zsh; + shell = pkgs.fish; }; users.users.nico.openssh.authorizedKeys.keys = [ diff --git a/stow/.config/fish/config.fish b/stow/.config/fish/config.fish new file mode 100644 index 0000000..e977293 --- /dev/null +++ b/stow/.config/fish/config.fish @@ -0,0 +1,22 @@ +if status is-interactive + # Commands to run in interactive sessions can go here + + # match prompt symbol to OS logo + if test -e /System + set pure_symbol_prompt "" + else + posix-source /etc/os-release + if [ "$ID" = "nixos" ] + set pure_symbol_prompt "" + else if [ "$ID" = "debian" ] + set pure_symbol_prompt "" + else if [ "$ID" = "fedora" ] + set pure_symbol_prompt "" + else if [ "$ID" = "arch" ] + set pure_symbol_prompt "󰣇" + end + end + + set pure_enable_single_line_prompt true + zoxide init fish | source +end diff --git a/stow/.config/fish/fish_variables b/stow/.config/fish/fish_variables new file mode 100644 index 0000000..1725016 --- /dev/null +++ b/stow/.config/fish/fish_variables @@ -0,0 +1,97 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3800 +SETUVAR fish_color_autosuggestion:brblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:normal +SETUVAR fish_color_comment:red +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:green +SETUVAR fish_color_error:brred +SETUVAR fish_color_escape:brcyan +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:brcyan +SETUVAR fish_color_param:cyan +SETUVAR fish_color_quote:yellow +SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold +SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:yellow\x1e\x2di +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR pure_begin_prompt_with_current_directory:true +SETUVAR pure_check_for_new_release:false +SETUVAR pure_color_at_sign:pure_color_mute +SETUVAR pure_color_aws_profile:pure_color_warning +SETUVAR pure_color_command_duration:pure_color_warning +SETUVAR pure_color_current_directory:pure_color_primary +SETUVAR pure_color_danger:red +SETUVAR pure_color_dark:black +SETUVAR pure_color_git_branch:pure_color_mute +SETUVAR pure_color_git_dirty:pure_color_mute +SETUVAR pure_color_git_stash:pure_color_info +SETUVAR pure_color_git_unpulled_commits:pure_color_info +SETUVAR pure_color_git_unpushed_commits:pure_color_info +SETUVAR pure_color_hostname:pure_color_mute +SETUVAR pure_color_info:cyan +SETUVAR pure_color_jobs:pure_color_normal +SETUVAR pure_color_k8s_context:pure_color_success +SETUVAR pure_color_k8s_namespace:pure_color_primary +SETUVAR pure_color_k8s_prefix:pure_color_info +SETUVAR pure_color_light:white +SETUVAR pure_color_mute:brblack +SETUVAR pure_color_nixdevshell_prefix:pure_color_info +SETUVAR pure_color_nixdevshell_symbol:pure_color_mute +SETUVAR pure_color_normal:normal +SETUVAR pure_color_prefix_root_prompt:pure_color_danger +SETUVAR pure_color_primary:blue +SETUVAR pure_color_prompt_on_error:pure_color_danger +SETUVAR pure_color_prompt_on_success:pure_color_success +SETUVAR pure_color_success:magenta +SETUVAR pure_color_system_time:pure_color_mute +SETUVAR pure_color_username_normal:pure_color_mute +SETUVAR pure_color_username_root:pure_color_light +SETUVAR pure_color_virtualenv:pure_color_mute +SETUVAR pure_color_warning:yellow +SETUVAR pure_enable_aws_profile:true +SETUVAR pure_enable_container_detection:true +SETUVAR pure_enable_git:true +SETUVAR pure_enable_k8s:false +SETUVAR pure_enable_nixdevshell:false +SETUVAR pure_enable_single_line_prompt:true +SETUVAR pure_enable_virtualenv:true +SETUVAR pure_reverse_prompt_symbol_in_vimode:true +SETUVAR pure_separate_prompt_on_error:false +SETUVAR pure_shorten_prompt_current_directory_length:0 +SETUVAR pure_shorten_window_title_current_directory_length:0 +SETUVAR pure_show_jobs:false +SETUVAR pure_show_prefix_root_prompt:false +SETUVAR pure_show_subsecond_command_duration:false +SETUVAR pure_show_system_time:false +SETUVAR pure_symbol_aws_profile_prefix: +SETUVAR pure_symbol_container_prefix: +SETUVAR pure_symbol_git_dirty:\x2a +SETUVAR pure_symbol_git_stash:\u2261 +SETUVAR pure_symbol_git_unpulled_commits:\u21e3 +SETUVAR pure_symbol_git_unpushed_commits:\u21e1 +SETUVAR pure_symbol_k8s_prefix:\u2638 +SETUVAR pure_symbol_nixdevshell_prefix:\u2744\ufe0f +SETUVAR pure_symbol_prefix_root_prompt:\x23 +SETUVAR pure_symbol_prompt:\ue843 +SETUVAR pure_symbol_reverse_prompt:\u276e +SETUVAR pure_symbol_ssh_prefix: +SETUVAR pure_symbol_title_bar_separator:\x2d +SETUVAR pure_symbol_virtualenv_prefix: +SETUVAR pure_threshold_command_duration:5 +SETUVAR pure_truncate_prompt_current_directory_keeps:\x2d1 +SETUVAR pure_truncate_window_title_current_directory_keeps:\x2d1 diff --git a/stow/.config/fish/functions/0x0.fish b/stow/.config/fish/functions/0x0.fish new file mode 100644 index 0000000..195318b --- /dev/null +++ b/stow/.config/fish/functions/0x0.fish @@ -0,0 +1,9 @@ +function 0x0 --description 'Uploads a file or folder to 0x0.st' + if test -d "$argv" + set TMPFILE "$(mktemp --suffix '.tar')" + tar cf "$TMPFILE" "$argv" + curl -F file="@$TMPFILE" -F expires=24 https://0x0.st + else + curl -F file=@"$argv" -F expires=24 https://0x0.st + end +end diff --git a/stow/.config/fish/functions/cat.fish b/stow/.config/fish/functions/cat.fish new file mode 100644 index 0000000..abbc480 --- /dev/null +++ b/stow/.config/fish/functions/cat.fish @@ -0,0 +1,4 @@ +function cat --wraps=bat --description 'alias cat bat' + bat $argv + +end diff --git a/stow/.config/fish/functions/la.fish b/stow/.config/fish/functions/la.fish new file mode 100644 index 0000000..d33eb8f --- /dev/null +++ b/stow/.config/fish/functions/la.fish @@ -0,0 +1,4 @@ +function la --wraps='ls -ah --color=auto' --description 'alias la=ls -ah --color=auto' + ls -ah --color=auto $argv + +end diff --git a/stow/.config/fish/functions/ll.fish b/stow/.config/fish/functions/ll.fish new file mode 100644 index 0000000..874614f --- /dev/null +++ b/stow/.config/fish/functions/ll.fish @@ -0,0 +1,4 @@ +function ll --wraps='ls -l' --wraps='ls -ahl --color=auto' --description 'alias ll=ls -ahl --color=auto' + ls -ahl --color=auto $argv + +end diff --git a/stow/.config/fish/functions/ls.fish b/stow/.config/fish/functions/ls.fish new file mode 100644 index 0000000..eaf48c8 --- /dev/null +++ b/stow/.config/fish/functions/ls.fish @@ -0,0 +1,4 @@ +function ls --description 'alias ls=ls -h --color=auto' + command ls -h --color=auto $argv + +end diff --git a/stow/.config/fish/functions/posix-source.fish b/stow/.config/fish/functions/posix-source.fish new file mode 100644 index 0000000..5147014 --- /dev/null +++ b/stow/.config/fish/functions/posix-source.fish @@ -0,0 +1,6 @@ +function posix-source + for i in (cat $argv) + set arr (echo $i |tr = \n) + set -gx $arr[1] $arr[2] + end +end diff --git a/stow/.config/fish/functions/rm.fish b/stow/.config/fish/functions/rm.fish new file mode 100644 index 0000000..5d4ae5f --- /dev/null +++ b/stow/.config/fish/functions/rm.fish @@ -0,0 +1,4 @@ +function rm --wraps=trash --description 'alias rm trash' + trash $argv + +end diff --git a/stow/.config/fish/functions/v.fish b/stow/.config/fish/functions/v.fish new file mode 100644 index 0000000..c4c8a12 --- /dev/null +++ b/stow/.config/fish/functions/v.fish @@ -0,0 +1,4 @@ +function v --wraps=nvim --description 'alias v nvim' + nvim $argv + +end diff --git a/stow/.config/fish/functions/vi.fish b/stow/.config/fish/functions/vi.fish new file mode 100644 index 0000000..1f236aa --- /dev/null +++ b/stow/.config/fish/functions/vi.fish @@ -0,0 +1,4 @@ +function vi --wraps=nvim --description 'alias vi nvim' + nvim $argv + +end diff --git a/stow/.config/fish/functions/vim.fish b/stow/.config/fish/functions/vim.fish new file mode 100644 index 0000000..67df688 --- /dev/null +++ b/stow/.config/fish/functions/vim.fish @@ -0,0 +1,4 @@ +function vim --wraps=nvim --description 'alias vim nvim' + nvim $argv + +end