move fish settings to own file and add broot

This commit is contained in:
Salar Rahmanian 2024-11-10 10:31:55 -08:00
parent 52ae41a79b
commit cbeb9fd9ea
4 changed files with 105 additions and 75 deletions

View file

@ -29,7 +29,9 @@
{ ... }:
{
nixpkgs.overlays = [ nur.overlay ];
imports = [ config ];
imports = [
config
];
};
m3maxConfiguration =

View file

@ -1,5 +1,4 @@
{
config,
lib,
pkgs,
...
@ -45,8 +44,6 @@
dua
fd
ffmpeg
fishPlugins.foreign-env
fishPlugins.bobthefish
font-awesome
gnupg
go
@ -114,6 +111,26 @@
enable = true;
};
programs.broot = {
enable = true;
enableFishIntegration = true;
settings = {
modal = true;
verbs = [
{
invocation = "panel_right";
key = "alt-right";
internal = ":panel_right";
}
{
invocation = "panel_left_no_open";
key = "alt-left";
internal = ":panel_left_no_open";
}
];
};
};
programs.btop = {
enable = true;
};
@ -209,77 +226,6 @@
};
};
programs.fish = {
enable = true;
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
plugins = [ ];
loginShellInit = ''
set -xg TERM xterm-256color
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
end
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
set -xg PATH /Users/salar/.luarocks/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $PATH
set -xg WORKSPACE /Users/salar/Projects
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
set -xg TOOLCHAINS swift
'';
interactiveShellInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
shellAliases = {
addsshmac = "ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain";
cat = "bat";
du = "dua i";
fzfp = "fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
ping = "prettyping";
".." = "cd ..";
pj = "python -m json.tool";
l = "ll";
g = "git";
ghauth = "gh auth login --with-token < ~/.ghauth";
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
giscala = "gitignore scala,vim,java,sbt > .gitignore";
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
grep = "grep --color=auto";
lg = "lazygit";
new-sbt = "sbt new scala/scala-seed.g8";
nixc = "cd ~/.config/nixpkgs";
nixre = "nix build && sudo ./result/activate";
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
nixgc = "nix-collect-garbage -d";
nixq = "nix-env -qa";
nixstorerepair = "nix-store --repair --verify --check-contents";
nixupgrade = "nix upgrade-nix";
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
v = "nvim";
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
sshhcloud1r = "ssh root@hcloud1.softinio.net";
};
};
# Neovim Configuration
xdg.configFile."nvim".source = builtins.fetchGit {
url = "https://code.softinio.com/softinio/nvim-config";

View file

@ -1,4 +1,5 @@
[
./fish
./git
./tmux
./wezterm

81
programs/fish/default.nix Normal file
View file

@ -0,0 +1,81 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
fish
fishPlugins.foreign-env
fishPlugins.bobthefish
];
programs.fish = {
enable = true;
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
plugins = [ ];
loginShellInit = ''
set -xg TERM xterm-256color
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
end
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
set -xg PATH /Users/salar/.luarocks/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $PATH
set -xg WORKSPACE /Users/salar/Projects
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
set -xg TOOLCHAINS swift
'';
interactiveShellInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
shellAliases = {
addsshmac = "ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain";
bf = "broot";
cat = "bat";
du = "dua i";
fzfp = "fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
ping = "prettyping";
".." = "cd ..";
pj = "python -m json.tool";
l = "ll";
g = "git";
ghauth = "gh auth login --with-token < ~/.ghauth";
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
giscala = "gitignore scala,vim,java,sbt > .gitignore";
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
grep = "grep --color=auto";
lg = "lazygit";
new-sbt = "sbt new scala/scala-seed.g8";
nixc = "cd ~/.config/nixpkgs";
nixre = "nix build && sudo ./result/activate";
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
nixgc = "nix-collect-garbage -d";
nixq = "nix-env -qa";
nixstorerepair = "nix-store --repair --verify --check-contents";
nixupgrade = "nix upgrade-nix";
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
v = "nvim";
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
sshhcloud1r = "ssh root@hcloud1.softinio.net";
};
};
}