mirror of
https://github.com/szymon-jozef/amazing-dotfiles.git
synced 2026-10-27 19:20:43 +01:00
update: modules/fish.nix
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
loginShellInit = ''
|
loginShellInit = ''
|
||||||
# Dodaje binarki Home Managera do PATH, jeśli jeszcze ich tam nie ma
|
|
||||||
fish_add_path --move --prepend --path "$HOME/.nix-profile/bin" /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
|
fish_add_path --move --prepend --path "$HOME/.nix-profile/bin" /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -25,5 +24,52 @@
|
|||||||
clear
|
clear
|
||||||
fastfetch --config ~/.config/fastfetch/startup.jsonc
|
fastfetch --config ~/.config/fastfetch/startup.jsonc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
functions = {
|
||||||
|
edit_dotfile = {
|
||||||
|
description = "Edit config file, reload, commit and push";
|
||||||
|
body = ''
|
||||||
|
set -l config_dir "$HOME/.config/home-manager"
|
||||||
|
set -l file
|
||||||
|
|
||||||
|
if test (count $argv) -gt 0
|
||||||
|
set file $argv[1]
|
||||||
|
else
|
||||||
|
set file (fd . $config_dir --type f --exclude ".git" | fzf)
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -n "$file"
|
||||||
|
set -l md5_before (md5sum $file)
|
||||||
|
|
||||||
|
nvim $file
|
||||||
|
|
||||||
|
if test "$md5_before" != (md5sum $file)
|
||||||
|
echo "Changes made. Prepparing commit..."
|
||||||
|
|
||||||
|
pushd $config_dir
|
||||||
|
|
||||||
|
git add $file
|
||||||
|
|
||||||
|
set -l rel_file (realpath --relative-to=$config_dir $file)
|
||||||
|
|
||||||
|
set commit_msg "update: $rel_file"
|
||||||
|
git commit -m "$commit_msg"
|
||||||
|
git push
|
||||||
|
|
||||||
|
home-manager switch -b backup
|
||||||
|
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
echo "No changes made"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ls = {
|
||||||
|
body = "eza --long --icons --all --group-directories-first --git $argv";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user