Nushell: fix custom aliases

This commit is contained in:
Filippo Berto 2025-08-21 13:55:01 +02:00
parent a6ccf64937
commit 4fe3cd913b
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
2 changed files with 19 additions and 18 deletions

View file

@ -1,11 +1,9 @@
{ {
programs.nushell = { programs.nushell = {
enable = true; enable = true;
# configFile.text = '' extraConfig = ''
# let-env config = { $env.config.show_banner = false
# show_banner: false '';
# }
# '';
envFile.text = ""; envFile.text = "";
}; };
} }

View file

@ -1,10 +1,10 @@
{ let
home.shellAliases = { common = {
"jc" = "journalctl"; "jc" = "journalctl";
"jcu" = "journalctl --user"; "jcu" = "journalctl --user";
"n" = "nix"; "n" = "nix";
"nb" = "nix build"; "nb" = "nix build";
"nf" = "find /nix/store/ -maxdepth 1 | grep";
"nr" = "nix repl"; "nr" = "nix repl";
"nR" = "nix run"; "nR" = "nix run";
"ns" = "nix search nixpkgs"; "ns" = "nix search nixpkgs";
@ -14,18 +14,14 @@
"sc" = "systemctl"; "sc" = "systemctl";
"scu" = "systemctl --user"; "scu" = "systemctl --user";
"rm" = "rm -i"; # Remove a file "rm" = "rm -i"; # Remove a file
"cp" = "cp -i"; # Copy a file "cp" = "cp -i"; # Copy a file
"mv" = "mv -i"; # Move a file "mv" = "mv -i"; # Move a file
"dud" = "du -d 1 -h"; # Display the size of files at depth 1 in current location in human-readable form "dud" = "du -d 1 -h"; # Display the size of files at depth 1 in current location in human-readable form
"duf*" = "du -sh"; # Display the size of files in current location in human-readable form
"t" = "tail -f"; # Shorthand for tail which outputs the last part of a file "t" = "tail -f"; # Shorthand for tail which outputs the last part of a file
"fd*" = "find . -type d -name"; # Find a directory with the given name
"ff" = "find . -type f -name"; # Find a file with the given name
"grep" = "grep --color"; # Searches for a query string "grep" = "grep --color"; # Searches for a query string
"sgrep" = "grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}"; # Useful for searching within files "sgrep" = "grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}"; # Useful for searching within files
@ -33,12 +29,19 @@
"h" = "history"; # Lists all recently used commands "h" = "history"; # Lists all recently used commands
"hgrep" = "fc -El 0 | grep"; # Searches for a word in the list of previously used commands "hgrep" = "fc -El 0 | grep"; # Searches for a word in the list of previously used commands
"help" = "man"; # Opens up the man page for a command "help" = "man"; # Opens up the man page for a command
"p" = "ps -f"; # Displays currently executing processes
"sortnr" = "sort -n -r"; # Used to sort the lines of a text file "sortnr" = "sort -n -r"; # Used to sort the lines of a text file
"unexport" = "unset"; # Used to unset an environment variable "unexport" = "unset"; # Used to unset an environment variable
}; };
# programs.bash = { inherit shellAliases; }; sh_only = {
# programs.zsh = { inherit shellAliases; }; "nf" = "find /nix/store/ -maxdepth 1 | grep";
"duf*" = "du -sh"; # Display the size of files in current location in human-readable form
"fd*" = "find . -type d -name"; # Find a directory with the given name
"ff" = "find . -type f -name"; # Find a file with the given name
"p" = "ps -f"; # Displays currently executing processes
};
in
{
home.shellAliases = common;
programs.bash.shellAliases = common // sh_only;
programs.zsh.shellAliases = common // sh_only;
} }