.files/nix/homeModules/common/fish/aliasesAbbrs.nix

30 lines
642 B
Nix

{
pkgs,
lib,
...
}: {
programs.fish = {
shellAbbrs = lib.mergeAttrsList [
(lib.optionalAttrs pkgs.stdenv.isLinux {
"," = "nix-shell -p";
})
];
shellAliases = lib.mergeAttrsList [
{
rm = "rm -I"; # idiot protection
tree = "tree -Cph";
}
(lib.optionalAttrs pkgs.stdenv.isLinux {
# idiot protection
chmod = "chmod --preserve-root";
chown = "chown --preserve-root";
# I can't make alias with a space, i.e. `nom shell`
nix-shell = "nix-shell --command fish";
nom-shell = "nom-shell --command fish";
})
];
};
}