diff --git a/modules/home/programs/waybar/config/config.jsonc b/modules/home/programs/waybar/config/config.jsonc index a1c5759f..2d71f5d1 100644 --- a/modules/home/programs/waybar/config/config.jsonc +++ b/modules/home/programs/waybar/config/config.jsonc @@ -115,8 +115,8 @@ "format": "{icon}", "format-icons": { "urgent": "", - "active": "", - "visible": "", + "active": "", + "visible": "", "default": "", "empty": "" }, diff --git a/modules/nixos/programs/fish/default.nix b/modules/nixos/programs/fish/default.nix index d8c063f6..014b1146 100644 --- a/modules/nixos/programs/fish/default.nix +++ b/modules/nixos/programs/fish/default.nix @@ -1,9 +1,12 @@ { config, lib, + pkgs, ... }: let + inherit (lib.meta) getExe; + inherit (pkgs) eza bat; inherit (lib) mkIf mkEnableOption; cfg = config.nixos.programs.fish; in @@ -14,11 +17,100 @@ in config = mkIf cfg.enable { programs.fish = { enable = true; - vendor = { - completions.enable = true; - config.enable = true; - functions.enable = true; + # plugins = [ + # { + # name = "hydro"; + # src = pkgs.fishPlugins.hydro; + # } + # ]; + shellAbbrs = { + extract = "extract.sh"; + nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot"; + nixclean = "nh clean all --keep 3"; + nixdev = "nix develop ~/.nix-config -c $SHELL"; + nixup = "nh os switch -H $hostname"; + nixupv = "nh os switch -v -H $hostname"; + flakeup = "nix flake update"; }; + shellAliases = { + ".." = "cd .."; + "..." = "cd ../../"; + "...." = "cd ../../../"; + "....." = "cd ../../../../"; + "......" = "cd ../../../../../"; + nixconfig = "cd /home/$USER/.nix-config/"; + homemodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules/{$hostname}mod.nix"; + hmod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules/{$hostname}mod.nix"; + nixsettings = "$EDITOR /home/$USER/.nix-config/hosts/$hostname/settings.nix"; + nset = "$EDITOR /home/$USER/.nix-config/hosts/$hostname/settings.nix"; + nixosmodules = "$EDITOR /home/$USER/.nix-config/hosts/$hostname/modules.nix"; + nmod = "$EDITOR /home/$USER/.nix-config/hosts/$hostname/modules.nix"; + tree = "${getExe eza} --tree --icons=always"; + cat = "${getExe bat} --style=plain"; + ls = "${getExe eza} -h --git --icons --color=auto --group-directories-first -s extension"; + ll = "${getExe eza} -l --git --icons --color=auto --group-directories-first -s extension"; + lat = "${getExe eza} -lah --tree --color=auto --group-directories-first -s extension"; + la = "${getExe eza} -lah --color=auto --group-directories-first -s extension"; + # Clear screen and scrollback + clear = "printf '\\033[2J\\033[3J\\033[1;1H'"; + }; + # functions = { + # # Disable greeting + # fish_greeting = ""; + # # Merge history when pressing up + # up-or-search = lib.readFile ./up-or-search.fish; + # # Check stuff in PATH + # nix-inspect = + # # fish + # '' + # set -s PATH | grep "PATH\[.*/nix/store" | cut -d '|' -f2 | grep -v -e "-man" -e "-terminfo" | perl -pe 's:^/nix/store/\w{32}-([^/]*)/bin$:\1:' | sort | uniq + # ''; + # }; + interactiveShellInit = + # fish + '' + # Open command buffer in vim when alt+e is pressed + bind \ee edit_command_buffer + + # Use vim bindings and cursors + fish_vi_key_bindings + set fish_cursor_default block blink + set fish_cursor_insert line blink + set fish_cursor_replace_one underscore blink + set fish_cursor_visual block + + # Use terminal colors + set -x fish_color_autosuggestion brblack + set -x fish_color_cancel -r + set -x fish_color_command brgreen + set -x fish_color_comment brmagenta + set -x fish_color_cwd green + set -x fish_color_cwd_root red + set -x fish_color_end brmagenta + set -x fish_color_error brred + set -x fish_color_escape brcyan + set -x fish_color_history_current --bold + set -x fish_color_host normal + set -x fish_color_host_remote yellow + set -x fish_color_match --background=brblue + set -x fish_color_normal normal + set -x fish_color_operator cyan + set -x fish_color_param brblue + set -x fish_color_quote yellow + set -x fish_color_redirection bryellow + set -x fish_color_search_match 'bryellow' '--background=brblack' + set -x fish_color_selection 'white' '--bold' '--background=brblack' + set -x fish_color_status red + set -x fish_color_user brgreen + set -x fish_color_valid_path --underline + set -x fish_pager_color_completion normal + set -x fish_pager_color_description yellow + set -x fish_pager_color_prefix 'white' '--bold' '--underline' + set -x fish_pager_color_progress 'brwhite' '--background=cyan' + + microfetch + ''; + }; }; } diff --git a/modules/nixos/programs/fish/up-or-search.fish b/modules/nixos/programs/fish/up-or-search.fish new file mode 100644 index 00000000..5ef444c8 --- /dev/null +++ b/modules/nixos/programs/fish/up-or-search.fish @@ -0,0 +1,22 @@ +# Taken from Misterio77 https://github.com/Misterio77/nix-config/blob/main/home/gabriel/features/cli/fish/up-or-search.fish +# Merge history upon doing up-or-search +# This lets multiple fish instances share history +if commandline --search-mode + commandline -f history-search-backward + return +end +if commandline --paging-mode + commandline -f up-line + return +end + +set -l lineno (commandline -L) + +switch $lineno + case 1 + commandline -f history-search-backward + # Here we go + history merge + case '*' + commandline -f up-line +end diff --git a/modules/nixos/services/agenix/default.nix b/modules/nixos/services/agenix/default.nix index 7fb2a886..b29e96a4 100644 --- a/modules/nixos/services/agenix/default.nix +++ b/modules/nixos/services/agenix/default.nix @@ -34,6 +34,11 @@ in default = false; description = "Apply sobotka agenix settings"; }; + ziggy.enable = mkOption { + type = lib.types.bool; + default = false; + description = "Apply ziggy agenix settings"; + }; toothpc.enable = mkOption { type = lib.types.bool; default = false; diff --git a/users/cnst/modules/kimamod.nix b/users/cnst/modules/kimamod.nix index fbbc64a4..ebdbec63 100644 --- a/users/cnst/modules/kimamod.nix +++ b/users/cnst/modules/kimamod.nix @@ -27,7 +27,7 @@ enable = true; }; fish = { - enable = true; + enable = false; }; foot = { enable = true;