Dup Ver Goto 📝

RustSetup001

PT2/linux/fedora/setup does not exist
To
63 lines, 327 words, 2442 chars Page 'RustSetup001' does not exist.

Install Rust with Rustup.

if [ ! -d ~/.cargo ]; then
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  . /home/john/.cargo/env
fi
cargo install sccache                                                                                                    

my cargo init script is

[ ! -d ~/.cargo ] && return # do nothing unless rust is installed
.if . "$HOME/.cargo/env"
if [ -x "$(which sccache 2>&1)" ]; then
  export RUSTC_WRAPPER=$(which sccache)
fi
cargoi() { cargo install; }
pathif -a "$HOME/.local/share/bob/nvim-bin"
rustbook() { rustup docs --book; }

If you're wondering why I don't use an alias for cargoi but define it as a function instead, consider what happens if I try to override it with a function definition (the alias will be expanded so that cargoi() { ... } will become cargo install() { ... } which will then try to run cargo rather than defining a function, so I'd need a script like the one below to first check if cargoi was an alias, and if so unalias it, and then define the function. It's easier to just make most things functions instead of aliases.)

Oxidise

This list largely comes from Tris video Oxidise Your Life. Fedora has slightly different prerequisites.

dnf install openssl-devel
dnf install alsa-lib-devel
dnf install perl-FindBin
dnf install perl-File-Compare

Then my installer script for it all:

cargoi() {
  for s; do
    cargo install "$s" 2>&1 | tee ~/usersetup/cargo-install-${s}.log
  done
}
cargoi coreutils       #
cargoi starship        # cross-shell advanced prompt
cargoi exa             # ls replacement
cargoi du-dust         # du replacement
cargoi bat             # cat replacement
cargoi zellij          #
cargoi mprocs          #
cargoi ripgrep         # grep replacement
cargoi bob-nvim        # nvim version manager
cargoi gitui           #
cargoi irust           # ipython-like interactive
cargoi evcxr_jupyter   #
cargoi bacon           # 
cargoi cargo-info      #
cargoi porsmo          #
cargoi wiki-tui        # wikipedia without a browser
cargoi rtx-cli         #
cargoi nu              # modern shell
cargoi tree-sitter-cli

Also rust-analyzer is useful, but it is a library so has to be added to a project via Cargo.toml.