Brings back install via Cargo

+1 -2
Dockerfile
··· 18 18 COPY --from=neovim /usr/local/lib/nvim /usr/local/lib/nvim 19 19 COPY --from=neovim /usr/local/bin/nvim /usr/local/bin/nvim 20 20 RUN apt update && \ 21 - apt install -y curl fd-find gcc git nodejs npm python3 python3-venv unzip wget && \ 21 + apt install -y curl gcc git nodejs npm python3 python3-venv unzip wget && \ 22 22 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && \ 23 - ln -s $(which fdfind) /usr/local/bin/fd && \ 24 23 rm -rf /var/lib/apt/lists/* 25 24 26 25 RUN useradd -ms /bin/bash cuducos
+17 -11
bootstrap.py
··· 6 6 from pathlib import Path 7 7 from stat import S_IXGRP, S_IXOTH, S_IXUSR 8 8 from tempfile import NamedTemporaryFile 9 - from urllib.request import urlopen 10 - 9 + from urllib.request import urlopen, urlretrieve 11 10 12 11 DOTFILES_DIR = Path.cwd() 13 12 DOTFILES_GIT = DOTFILES_DIR / ".git" 14 13 HOME_DIR = Path.home() 14 + CARGO_BIN = HOME_DIR / ".cargo" / "bin" / "cargo" 15 15 16 16 CONFIG_FILE_NAMES = (".fdignore", ".gitconfig", ".gitignore_global", ".ripgreprc") 17 17 CONFIG_FILES = (DOTFILES_DIR / f for f in CONFIG_FILE_NAMES) ··· 39 39 FONTS = dict(zip(FONT_KEYS, MAC_FONTS if IS_MAC else LINUX_FONTS)) 40 40 41 41 APT_PKGS = ("fd-find", "bat", "unzip") 42 + CRATES_PKGS = ("sd", "typos-cli") 42 43 DEB_PKGS = ( 43 44 "https://github.com/dandavison/delta/releases/download/0.16.5/git-delta_0.16.5_amd64.deb", 44 45 "https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb", 45 - ) 46 - BIN_PKGS = ( 47 - ( 48 - "sd", 49 - "https://github.com/chmln/sd/releases/download/v0.7.6/sd-v0.7.6-x86_64-unknown-linux-gnu", 50 - ), 51 46 ) 52 47 53 48 ··· 105 100 target.symlink_to(path) 106 101 107 102 103 + def install_cargo(): 104 + with NamedTemporaryFile() as tmp: 105 + urlretrieve("https://sh.rustup.rs", filename=tmp.name) 106 + os.system(f"sh {tmp.name} -y") 107 + 108 + 109 + def install_with_cargo(pkg): 110 + os.system(f"{CARGO_BIN} install {pkg}") 111 + 112 + 108 113 def install_bin(name, url): 109 114 bin = HOME_DIR / "bin" 110 115 if not bin.exists(): ··· 117 122 118 123 def install_deb(url): 119 124 with NamedTemporaryFile(suffix=".deb") as tmp: 120 - download_as(url, tmp.name) 125 + download_as(url, Path(tmp.name)) 121 126 cmd = f"dpkg -i {tmp.name}" 122 127 if which("sudo"): 123 128 cmd = f"sudo {cmd}" ··· 140 145 141 146 with ConcurrentRunner() as runner: 142 147 runner.run(install_via_package_manager) 143 - for name, url in BIN_PKGS: 144 - runner.run(install_bin, name, url) 148 + install_cargo() 149 + for pkg in CRATES_PKGS: 150 + runner.run(install_with_cargo, pkg) 145 151 146 152 147 153 def configure_kitty():
+2
pyproject.toml
··· 1 + [tool.ruff] 2 + extend-select = ["I"]