update con

This commit is contained in:
iofq 2024-09-08 13:39:39 -05:00
parent d7d5226ed2
commit 001edf9832
15 changed files with 214 additions and 93 deletions

View file

@ -11,8 +11,55 @@
packages = with pkgs; [
tree
eza
bat
];
};
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
set -U tide_right_prompt_items status\x1ecmd_duration\x1etime
'';
shellInit = "
fish_add_path /usr/local/go/bin
fish_add_path ~/go/bin
fish_add_path ~/.local/bin
set -gx MANPAGER 'nvim +Man!'
set -gx EDITOR 'nvim'
set -gx _JAVA_AWT_WM_NONREPARENTING 1
set -gx NIX_FLAKE '/home/e/dev/nix'
";
plugins = [
{ name = "fzf"; src = pkgs.fishPlugins.fzf-fish.src; }
{ name = "puffer"; src = pkgs.fishPlugins.puffer.src; }
];
functions = {
nix = {
wraps = "nix";
body = ''
if status is-interactive
and test (count $argv) = 1 -a "$argv[1]" = develop
nix develop --command (status fish-path)
else
command nix $argv
end
'';
};
};
shellAbbrs = {
g = "git";
k = "kubectl";
};
shellAliases = {
":q" = "exit";
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
nvim-dev = "nix run ~/dev/nvim.nix";
mpv = "mpv --no-keepaspect-window";
cat = "bat -P";
tcd = "cd $(mktemp -d)";
};
};
programs.bash = {
enable = true;
enableCompletion = true;
@ -25,13 +72,6 @@
la = "eza -lahr";
ll = "la";
":q" = "exit";
mpv = "mpv --no-keepaspect-window";
hms = "home-manager switch --flake $NIX_FLAKE#${host.username}";
rbs = "sudo nixos-rebuild switch --flake $NIX_FLAKE#${host.hostName}";
update = "nix flake update $NIX_FLAKE && rbs && hms";
nvim-dev = "nix run ~/dev/nvim.nix";
g = "git";
k = "kubectl";
};
shellOptions = [
"cmdhist"
@ -45,15 +85,8 @@
bashrcExtra = ''
export PROMPT_COMMAND="prompt_command;history -a"
export PATH="/usr/local/go/bin:~/go/bin:~/.bin:~/.local/bin:$PATH"
export GPG_2FA="mail@10110110.xyz"
export MANPAGER="nvim +Man!"
export EDITOR="nvim"
export _JAVA_AWT_WM_NONREPARENTING=1
export NIX_FLAKE="/home/e/dev/nix"
[[ $- != *i* ]] && return
function exists {
type $1 >/dev/null 2>&1
}
function prompt_command {
GIT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null | cut -c 1-10)
@ -72,7 +105,13 @@
cmd="eza"
builtin cd "$@" && $cmd
}
exists "kubectl" && source <(kubectl completion bash)
'';
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.fzf = {
@ -82,6 +121,7 @@
};
programs.direnv = {
enable = true;
silent = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};