feat(install): Rust toolchain via rustup, cargo env sourced by the rc files
install_rust(): official rustup script as the user (stable, default profile, --no-modify-path), rustup update on a re-run, rust-analyzer + rust-src added. libssl-dev (apt) / openssl@3 (brew) for openssl-sys crates. bashrc-linux, bashrc-osx and zshrc-osx source ~/.cargo/env when present. README, CHANGELOG, CLAUDE.md, TODO plan.
This commit is contained in:
1 parent
f825caf094
commit
7d62da44b0
8 files changed
+59
-6
No files matched your search
@@ -16,7 +16,7 @@ curl -fsSL https://git.bchanot.fr/bchanot/config/raw/branch/main/remote-install.
|
||||
|
||||
| Path | Purpose |
|
||||
| -------------------- | -------------------------------------------------------------- |
|
||||
| `install.sh` | Linux: installs apt packages + Docker + code-server, offers the GNOME desktop + RDP (gnome-remote-desktop; default no on WSL), backs up old config, deploys vim + bashrc (OS-detected), installs CLI scripts, pipx tools and a low-disk login warning; ends by offering four extras (`/tmp` on disk, SSH memory guard, the `cloudpex` NAS mount helper, rootless Docker). macOS: same tooling through Homebrew (see [macOS](#macos)), deploys the tmux config, then prints what was not installed compared with Linux. |
|
||||
| `install.sh` | Linux: installs apt packages + Docker + code-server, offers the GNOME desktop + RDP (gnome-remote-desktop; default no on WSL), backs up old config, deploys vim + bashrc (OS-detected), installs CLI scripts, pipx tools, the Rust toolchain (rustup) and a low-disk login warning; ends by offering four extras (`/tmp` on disk, SSH memory guard, the `cloudpex` NAS mount helper, rootless Docker). macOS: same tooling through Homebrew (see [macOS](#macos)), deploys the tmux config, then prints what was not installed compared with Linux. |
|
||||
| `tmux.conf` | tmux config (vi keys, mouse, status bar, tpm plugins: resurrect + continuum session restore, window-name). Deployed on both OSes to `~/.config/tmux/tmux.conf` (tmux ≥ 3.1). |
|
||||
| `cloudpex/` | On-demand SMB mount of a NAS share (`cloudpex` command + its installer, offered `[y/N]` at the end of a Linux install). Site values (host, share, SMB user, mount point, SMB version) are prompted at install and stored in `/etc/cloudpex.conf`, never in the script. French README inside. |
|
||||
| `etc/tmpfiles.d/tmp.conf` | Cleanup rules for a disk-backed `/tmp` (wiped at boot, 10-day purge). Deployed by the `/tmp` on disk offer. |
|
||||
@@ -69,7 +69,7 @@ What it does:
|
||||
4. Clones the `syntastic` and `nerdtree` vim plugins into `~/.vim/bundle/`.
|
||||
5. Copies the tracked vim files into `~/.vim` and symlinks `~/.vimrc`.
|
||||
6. Picks the bashrc by OS: macOS → `bashrc-osx` (falls back to `bashrc-linux` if missing), everything else → `bashrc-linux`. Renders it into `~/.bashrc` with the identity asked at the very start: a name and an email for git commits and vim headers. An `export USER=` / `export EMAIL=` already present in `~/.bashrc` or `~/.zshrc` is reused without asking, so a re-run never prompts twice; `IDENTITY_USER` / `IDENTITY_EMAIL` preset them; with no terminal attached it falls back to the login name and an empty email. The values live only in the deployed files, never in the repo. Then renders `gitconfig` into `~/.gitconfig` with the same name and email (skipped, push mode included, when the name or email is empty, e.g. a first install with no terminal and no `IDENTITY_EMAIL`). The installer asks once whether the gitflow hooks push every commit and merge (`true` or `false` exactly, Enter = `true`); a `true`/`false` already in `~/.gitconfig` is reused without asking and survives the redeploy; `DOTFILES_GITFLOW_AUTOPUSH=true|false` presets it for a non-interactive install, an existing `~/.gitconfig` value still winning (no terminal and no preset gives `true`; any other preset aborts the install); the render refuses to write a file where `@AUTOPUSH@` leaked, since a non-boolean value blocks every push. To switch later: `git config --global gitflow.autopush true|false`. A different existing `~/.gitconfig` is saved as `~/.gitconfig.backup-<date>`; an identical one is left alone. It is the global level only: a repo's own `.git/config` still overrides it. `core.excludesfile` points at `~/.gitignore`, ignored by git when the file does not exist. `core.hooksPath` is fixed to `~/.claude/githooks`, the gitflow hooks created by `make link` in the claude-config repo; the installer neither creates nor checks that directory. Being global, it makes git ignore each repo's `.git/hooks/` unless that repo sets its own `core.hooksPath`. Then deploys `tmux.conf` to `~/.config/tmux/tmux.conf` (both OSes, tmux ≥ 3.1: Ubuntu 22.04+, brew), clones [tpm](https://github.com/tmux-plugins/tpm) and fetches the listed plugins headlessly; details under [macOS](#macos) step 6, the step is the same. On Linux, `y` copies into tmux's buffer and the terminal clipboard through OSC 52; macOS uses `pbcopy`/`pbpaste`.
|
||||
7. Installs Python CLIs via `pipx` (`PyMuPDF` → `pymupdf`, `Markdown` → `markdown_py`) — skipped if `pipx` is absent.
|
||||
7. Installs Python CLIs via `pipx` (`PyMuPDF` → `pymupdf`, `Markdown` → `markdown_py`) — skipped if `pipx` is absent. Then installs the **Rust toolchain** on both OSes with the official `rustup` script, as you, never `sudo`: `stable` toolchain, default profile (`rustc cargo rust-std rust-docs rustfmt clippy`) plus `rust-analyzer` and `rust-src` for IDE support. On a re-run an existing `rustup` is updated (`rustup update`) instead of reinstalled. The script runs with `--no-modify-path`: the deployed bashrc/zshrc source `~/.cargo/env` when it exists, which puts `~/.cargo/bin` on `PATH` once. `CARGO_HOME` and `RUSTUP_HOME` keep their defaults (`~/.cargo`, `~/.rustup`). `libssl-dev` (apt) / `openssl@3` (brew) are installed so crates on `openssl-sys` build.
|
||||
8. Copies the `bin/` scripts (`dt`, `dtach-router`, `claude-provider`, `repo-sync`, `tmux-copy-exit-keys`) into `~/.local/bin`. The dtach session-resume menu ships in the deployed bashrc (both OSes), so every interactive shell offers it — including VS Code Remote-SSH terminals, which are non-login and never read `~/.profile`. The installer also strips any older dtach block left in `~/.profile` so a plain SSH login doesn't prompt twice.
|
||||
9. On Linux, installs `etc/profile.d/disk-usage-warning.sh` to `/etc/profile.d/` (needs `sudo`) so each login warns when `/` or `/home` cross 85% usage.
|
||||
10. On Linux, installs **code-server** (VS Code in the browser) via its vendor script — skipped if already present — and enables the `code-server@<login>` systemd service (login from `id -un`: the bashrc overrides `$USER`).
|
||||
@@ -83,7 +83,7 @@ What it does:
|
||||
### Packages installed (apt)
|
||||
|
||||
- **Build / VCS / C dev**: `vim git git-lfs git-filter-repo gitleaks gcc make pkg-config dkms valgrind shellcheck gh git-delta` (`git-delta` = `delta`, the pager set in `gitconfig`)
|
||||
- **Net / security / transport**: `curl gnupg ca-certificates apt-transport-https net-tools openssh-server cifs-utils lftp ftp`
|
||||
- **Net / security / transport**: `curl gnupg ca-certificates apt-transport-https libssl-dev net-tools openssh-server cifs-utils lftp ftp` (`libssl-dev`: build dependency of the `openssl-sys` Rust crate)
|
||||
- **Shell tooling**: `unzip tree tmux fzf dtach`
|
||||
- **Runtimes**: `nodejs python3-pip pipx php-cli`
|
||||
- **Web stack (local WordPress/LAMP)**: `mariadb-server imagemagick php-mysql php-gd php-imagick php-mbstring php-xml php-intl php-curl` (unversioned `php-*` metapackages, so they follow the distro's PHP)
|
||||
@@ -92,6 +92,7 @@ What it does:
|
||||
- **Desktop / GPU**: `ubuntu-desktop-minimal` (offered, Linux; default yes, no on WSL) + the distro-recommended NVIDIA driver via `ubuntu-drivers install` (only when an NVIDIA GPU is detected)
|
||||
- **Remote access**: `gnome-remote-desktop openssl` (apt, offered after the desktop) + `code-server` (via its vendor install script, not apt) — RDP remote login + browser VS Code
|
||||
- **pipx**: `PyMuPDF` (`pymupdf`), `Markdown` (`markdown_py`)
|
||||
- **Rust (rustup, not apt)**: `stable` toolchain, default profile + `rust-analyzer rust-src`
|
||||
- **Security baseline (Linux, always)**: `fail2ban nftables unattended-upgrades`
|
||||
- **Optional (end-of-install offer, Linux)**: `earlyoom`; `uidmap dbus-user-session slirp4netns` (rootless Docker)
|
||||
|
||||
@@ -104,7 +105,7 @@ The script is re-runnable: each run re-backs up to `~/Oldconfig` (overwriting th
|
||||
The same `./install.sh` detects macOS and replaces `apt-get` with Homebrew. After the identity and push-mode questions, it asks which login shell you want, **zsh** or **bash** (`[zsh]` by default; answer in advance with `MACOS_SHELL=bash ./install.sh`, and with no terminal attached it picks zsh):
|
||||
|
||||
1. Installs Homebrew with its official script when `brew` is missing (this also pulls the Xcode Command Line Tools: clang, make, git), then `brew update` + `brew upgrade`.
|
||||
2. Installs the apt list mapped to formulae: `vim git git-lfs git-filter-repo gitleaks pkgconf shellcheck gh git-delta curl gnupg lftp inetutils unzip tree tmux fzf dtach node python pipx php mariadb imagemagick ffmpeg weasyprint poppler qpdf webp libavif bash`. Brew's `php` already ships gd, mbstring, xml, intl, curl and mysql.
|
||||
2. Installs the apt list mapped to formulae: `vim git git-lfs git-filter-repo gitleaks pkgconf shellcheck gh git-delta curl gnupg lftp inetutils openssl@3 unzip tree tmux fzf dtach node python pipx php mariadb imagemagick ffmpeg weasyprint poppler qpdf webp libavif bash`. Brew's `php` already ships gd, mbstring, xml, intl, curl and mysql.
|
||||
3. Docker: `colima` (the Linux VM) + `docker docker-compose docker-buildx`. Writes `~/.docker/config.json` with `cliPluginsExtraDirs` so `docker compose` works, only when that file does not exist yet (otherwise prints the line to add).
|
||||
4. Starts `colima`, `code-server` and `mariadb` as `brew services` (the `systemctl enable --now` equivalent), skipping any already started.
|
||||
5. Deploys `bashrc-osx`, then appends one line to `~/.bash_profile` that sources `~/.bashrc`: macOS terminals open login shells, which never read `~/.bashrc` on their own. Done for both choices, so `bash` stays usable.
|
||||
|
||||
Reference in new issue
Block a user