kergoth / system-setup

Kergoth's System Setup Scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Christopher Larson's Personal System Setup Scripts

BlueOak 1.0.0 License

This repository includes scripts for setting up systems per my personal preferences.

Prerequisites

  • (On macOS) Command-Line Tools or XCode must be installed (See extras/ for scripts to install these).

Usage

The scripts are split into 4 phases, each of which is manually run:

The first two scripts are currently only used for non-Windows hosts. These are self-contained and may be used without cloning the repository:

  • os-install: Currently I only have a single script for this, which is Arch. This is run as root, prior to rebooting into the newly installed system, and is intended to install and perform initial early system setup such as bootloader installation. This script is intended to be able to run without cloning this repository, so must be self-contained, and by definition is os/distro-specific, so exists in a subdirectory of script/ for each.
  • setup-root: This is run as root, after OS installation, before our user has sudo/doas access, possibly before our user exists, and its purpose is to do just this, add our user and ensure it can use sudo or doas, and nothing more. This script is intended to be able to run without cloning this repository, so must be self-contained, and by definition is os/distro-specific, so exists in a subdirectory of script/ for each.

The remaining two are common to all hosts, but are powershell scripts on Windows (.ps1 extension):

  • setup-admin: This is run by a non-root user with sudo/doas access, to perform post-install system-level setup and configuration.
  • setup: This is run by our non-root user with no need for sudo/doas. This may be the same user as is used for setup-admin, but this is not required.

Lastly, a wrapper script script/bootstrap is provided which clones the repository, installing git first if necessary, and then runs the setup-admin and setup scripts. This is self-contained also. No bootstrap.ps1 is currently provided.

Manual Steps

macOS

  • Enable secure keyboard entry in Terminal
  • ./scripts/extras/enable-filevault
  • System Settings > Lock Screen
    • Set “Require password after screen saver begins or display is turned off” to after 5 seconds or less.
  • System Settings > Privacy & Security > Security
    • Set “Allow applications downloaded from App Store and identified developers” at most.
  • Run vscode, enable settings sync
  • Run vivaldi, enable sync
  • Run deliveries, click yes to import from iCloud
  • Run musicharbor, click yes to import from iCloud
  • Run appcleaner, preferences, enable smartdelete
  • Run alfred, preferences, advanced, enable sync to ~/Sync/App Settings/Alfred
  • Safari
    • Change the default scale to 85%
    • Add site settings icon
    • Add cloud tabs icon
    • Rearrange icons
  • Syncthing Shares
    • Sync/dotfiles-local
    • Sync/App Settings
    • Library/Fonts

Windows

  • Set up all my Syncthing shares
  • Restore from backup:
    • $USERPROFILE/Apps
    • Vivaldi: AppData/Local/Vivaldi/User Data/Default/
    • HexChat: AppData/Roaming/HexChat
    • archwsl disk image
  • Run QuickLook, right click its icon, click start at login
  • Create link to CapsLockCtrlEscape.exe in Startup (win-r -> shell:startup)
  • Install Fonts from Sync/Fonts
  • Run vscode, enable settings sync
  • Run an elevated WSL terminal, clone dotfiles into $USERPROFILE/dotfiles, and run:
./script/install -d $USERPROFILE -f windows-terminal powershell git`
  • Run ssh-add in powershell to add my key to the agent, if it exists
  • Remove Edge, Store, Mail from the task bar pins.

Apps Installed

CLI apps installed

  • wget: A free software package for retrieving files using HTTP, HTTPS, FTP and FTPS.

  • git: A free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

  • git-lfs: An open source Git extension for versioning large files.

  • neovim: Hyperextensible Vim-based text editor.

  • rust: A multi-paradigm, general-purpose programming language.

  • go: An open source programming language supported by Google

  • python: A programming language that lets you work quickly and integrate systems more effectively.

  • pipx: Install and run python applications in isolated environments.

  • bat: A cat(1) clone with syntax highlighting and Git integration.

  • choose: A human-friendly and fast alternative to cut and (sometimes) awk.

  • delta: A syntax-highlighting pager for git, diff, and grep output.

  • direnv: An extension for your shell which can load and unload environment variables depending on the current directory.

  • duf: Disk Usage/Free Utility - a better 'df' alternative.

  • dua: View disk space usage and delete unwanted data, fast. This is a faster version of ncdu.

  • dust: A more intuitive version of du in rust.

  • eza or exa: A modern replacement for ls.

  • fd: A simple, fast and user-friendly alternative to 'find'.

  • fzf: A command-line fuzzy finder.

  • git-absorb: git commit --fixup, but automatic.

  • git-branchless: High-velocity, monorepo-scale workflow for Git.

  • git-imerge: Incremental merge for git.

  • git-revise: A handy tool for doing efficient in-memory commit rebases & fixups.

  • jira-cli: Feature-rich interactive Jira command line.

  • jq: A lightweight and flexible command-line JSON processor.

  • peru: A generic package manager, for including other people's code in your projects.

  • ripgrep: A line-oriented search tool that recursively searches the current directory for a regex pattern.

  • sad: CLI search and replace | Space Age seD.

  • sapling: A Scalable, User-Friendly Source Control System.

  • sd: Intuitive find & replace CLI (sed alternative).

  • shellcheck: A static analysis tool for shell scripts.

  • shfmt: Format shell programs.

  • unar: Universal archives extractor. Available via brew, nix, and scoop.

  • zoxide: A smarter cd command, inspired by z and autojump.

  • zstd: Zstandard - Fast real-time compression algorithm.

Linux and macOS

  • nix: Nix is a tool that takes a unique approach to package management and system configuration.

  • patchutils: A small collection of programs that operate on patch files.

    • On Windows, patchutils can be used via either WSl or MSYS2 (which can be installed via scoop and run as msys2, ex. msys2 -c 'exec filterdiff "$@"' -).
  • ssh-copy-id: Install your identity.pub in a remote machine’s authorized_keys.

    • On Windows, I have a powershell function which does this, and is aliased to ssh-copy-id.
  • tmux: An open-source terminal multiplexer.

    • There are no good options for tmux or tmux-equivalent on Windows. The closest you can get is just splits in Windows Terminal, which doesn't give you the ability to disconnect.

macOS

  • lima: Linux virtual machines, typically on macOS, for running containerd.
  • colima: Container runtimes on macOS (and Linux) with minimal setup.
  • duti: A command-line tool to select default applications for document types and URL schemes on Mac OS X.
  • mas: Mac App Store command line interface.
  • reattach-to-user-namespace: Reattach to the per-user bootstrap namespace. This is needed for tools like tmux, though tmux 2.6+ apparently incorporates this functionality already.
  • trash: A small command-line program for OS X that moves files or folders to the trash.

Linux and FreeBSD

The intention is to incorporate the installation of Nix on all systems in time.

  • zsh: A shell designed for interactive use, although it is also a powerful scripting language. This is installed by default on macOS.
Arch Linux
  • openssh: The premier connectivity tool for remote login with the SSH protocol.
  • avahi: A system which facilitates service discovery on a local network via mDNS.
  • nss-mdns: A GNU Libc NSS module that provides mDNS host name resolution.

Windows

  • Build Tools for Visual Studio 2022: These Build Tools allow you to build Visual Studio projects from a command-line interface.
  • gow: Unix command line utilities installer for Windows.
  • npiperelay: Access Windows named pipes from WSL.
  • scoop: A command-line installer for Windows.
  • starship: A cross-shell prompt.
  • winget: Windows Package Manager CLI.
Powershell Modules
  • DirColors: Provides dircolors-like functionality to all System.IO.FilesystemInfo formatters.
  • Recycle: Deletes the file or folder as if it had been done via File Explorer, or restores a deleted file from the recycle bin.
  • posh-alias: A better alias for Powershell.

GUI apps installed

Windows and macOS

macOS (Pre-Sonoma Only)

  • Aerial: A macOS screensaver that lets you play videos from Apple's tvOS screensaver.

macOS

Fonts
QuickLook Plugins
  • Apparency: Preview the contents of a macOS app
  • BetterZip: A trialware file archiver. I only install this for the QuickLook plugin.
  • QLColorCode: A Quick Look plug-in that renders source code with syntax highlighting
  • qlImageSize: Display image size and resolution
  • QLMarkDown: Preview Markdown files
  • QLPrettyPatch: QuickLook generator for patch files
  • QLStephen: Preview plain text files without or with unknown file extension. Example: README, CHANGELOG, index.styl, etc
  • QLVideo: Preview most types of video files, as well as their thumbnails, cover art and metadata
  • quicklook-csv: A QuickLook plugin for CSV files
  • QuickLookJSON: A useful quick look plugin to preview JSON files
  • QuickLookASE: Preview Adobe ASE Color Swatches generated with Adobe Photoshop, Adobe Illustrator, Adobe Color CC, Spectrum, COLOURlovers, Prisma, among many others
  • Suspicious Package: Preview the contents of a standard Apple installer package
  • WebPQuickLook

Windows

Apps I install on an as-needed basis

CLI

  • asciinema]: Recording terminal sessions and sharing them on the web. Available via brew, nix, and python.
  • broot: A new way to see and navigate directory trees. Available via brew, nix, scoop, and cargo.
  • chars. Tool to display names and codes for unicode codepoints. Available via brew, nix, and cargo.
  • csview: 📠 Pretty and fast csv viewer for cli with cjk/emoji support. Available via brew, nix, scoop, and cargo.
  • csvkit: A suite of utilities for converting to and working with CSV. Available via brew, nix, and python.
  • dasel: Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Available via brew, nix, scoop, and go.
  • dirdiff: Efficiently compute the differences between two directories. Available via cargo as dirdiff-ocamlpro.
  • dog: A command-line DNS client. Available via brew as dog, nix as dogdns, and cargo from the source.
  • eva: A simple calculator REPL, similar to bc. Available via brew, nix, and cargo.
  • fast: Minimal zero-dependency utility for testing your internet download speed from terminal. Available via nix as fast-cli and go.
  • fclones: Finds and removes duplicate files. Available via brew, nix, and cargo.
  • ffmpeg: A complete, cross-platform solution to record, convert and stream audio and video. Available via brew, nix, and scoop.
  • flint: Check your project for common sources of contributor friction. Available via brew as flint-checker and go.
  • git-filter-repo: Quickly rewrite git repository history (filter-branch replacement).
  • hexyl: A simple hex viewer for the terminal. Available via brew, nix, and cargo.
  • htop: An interactive process viewer. Available via brew and nix.
  • httpie: A command-line HTTP client. Available via brew, nix, and python.
  • huniq: Command line utility to remove duplicates from the given input. Available via nix and cargo. Uses less memory than awk/uniq-seen. Rarely needed.
  • hyperfine: A command-line benchmarking tool. Available via brew, nix, and cargo.
  • petname: Generate human readable random names. Available via pypi and cargo.
  • procs: A modern replacement for ps written in Rust. Available via brew, nix, scoop, and cargo.
  • pup: A command line tool for processing HTML. Available via brew, nix, and go.
  • titlecase: A small tool that capitalizes English text. Available via cargo.
  • vivid: A generator for the LS_COLORS environment variable. Available via brew, nix, and cargo.
  • youtube-dl: Video downloading. Available via brew, nix, and python.

On my NAS, to download what I own

  • lgogdownloader: Unofficial downloader for GOG.com. Available via brew and nix.

To deal with icons and images

  • icoutils: A set of command-line programs for extracting and converting images in Microsoft Windows(R) icon and cursor files. Available via brew and nix.
  • imagemagick: Create, edit, compose, or convert digital images. Available via brew, nix, and scoop.

For beets

  • mp3val: A small, high-speed, free software tool for checking MPEG audio files' integrity. Available via brew and nix. Also available as direct binary download for Windows.
  • par2cmdline: Available via brew as par2, nix, and scoop.

macOS

  • makeicns: Create icns files from the command line. Available via brew.
  • terminal-notifier: A command-line tool to send macOS User Notifications. Available via brew and nix.

GUI

  • Battle.net: Blizzard games client. Available via brew as battle-net.
  • MusicBrainz Picard: A cross-platform music tagger. Available via brew as musicbrainz-picard, nix as picard, Microsoft Store, winget as MusicBrainz.Picard, and scoop as picard.
  • Steam: A digital distribution platform. Available via brew, nix, and winget as Valve.Steam.
  • Tor Browser: Browser with a focus on anonymity using the Tor Network. Available via brew as tor-browser, nix as tor-browser-bundle-bin, and winget as TorProject.TorBrowser.

macOS

  • Adapter: Convert Video, Audio and Images. Available via brew as adapter.
  • Gemini 2: The intelligent duplicate file finder. Available via brew as gemini.
  • Numbers: Create impressive spreadsheets. Available via Mac App Store.
  • Pages: Documents that stand apart. Available via Mac App Store.
  • PhotoSweeper: A fast & powerful duplicate photos cleaner for Mac. Available via brew as photosweeper-x.
  • Pixelmator: Powerful, full-featured image editor for Mac. Available via Mac App Store.
  • SwiftBar]: Powerful macOS menu bar customization tool.
  • Wineskin: A user-friendly tool used to make ports of Microsoft Windows software to macOS. Available via brew as gcenx/wine/unofficial-wineskin.

Windows (All are available via winget)

Background and Considerations

I have chosen to write these from scratch at this time for simplicity, and the limited support for Ansible on Windows without also having a Linux host nearby. I will continue to look into other options, but for now, this should meet my needs.

Limitations

Currently, these scripts do not fully handle everything I would like, such as system bootstrapping and early configuration.

Help

Questions and comments are always welcome, please open an issue.

Contributing

Contributions of all kinds, including feedback, are always welcome!

See CONTRIBUTING.md for ways to get started.

Please adhere to this project's Code of Conduct and follow The Ethical Source Principles.

License

Distributed under the terms of the Blue Oak Model License 1.0.0 license.

See Also

Superseded Projects

Partially Superseded Projects

About

Kergoth's System Setup Scripts

License:Other


Languages

Language:Shell 65.2%Language:PowerShell 28.0%Language:Nix 4.3%Language:Ruby 2.2%Language:Python 0.3%