Some cool commands for nix

This commit is contained in:
Natsu Kagami 2022-11-01 11:09:05 +01:00
parent e6652536fe
commit 1b39ae8f40
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51

View file

@ -10,7 +10,24 @@
programs.fish = {
enable = true;
package = pkgs.unstable.fish;
functions = { };
functions = {
# Simplify nix usage!
nx = "test (count $argv) -gt 0 && nix run nixpkgs#$argv[1] -- $argv[2..]";
nsh = "test (count $argv) -gt 0 && nix shell nixpkgs#$argv -c fish";
# Grep stuff
eg = {
body = ''
if test (count $argv) -gt 0
${pkgs.ripgrep}/bin/rg --vimgrep $argv | e
else
echo "eg {ripgrep options}"
return 1
end
'';
wraps = "rg";
description = "Search with ripgrep and put results into the editor";
};
};
tide = {
nix-shell.enable = true;