Kergoth's Dotfiles and Setup Scripts
This repository includes scripts for setting up systems per my personal preferences.
Prerequisites
- (On macOS) Command-Line Tools or XCode must be installed (See scripts/extras/ for scripts to install these).
Usage
Initial dotfiles setup
This setup will apply the dotfiles, and will also install packages with home-manager, if nix is installed.
If the repository has not yet been cloned:
chezmoi init --apply kergoth/dotfiles
If the repository is already cloned and you've changed directory to it:
./script/setup
User Setup
This setup will apply the dotfiles, but will also apply other changes to the current user configuration.
After cloning the repository, and changing directory to it, run:
./script/setup-user
On windows (in powershell, not WSL), run this instead:
./script/setup-user.ps1
System Setup
On Arch and FreeBSD, early setup scripts exist in ./script/arch and ./script/freebsd, respectively. 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 setup-system script is run by a non-root user with sudo/doas access, to perform post-install system-level setup and configuration. This script will apply changes to the system as a whole. This may include installing packages through the package manager, installing nix, et cetera. Ideally this should be run prior to setting up the user, and should be run as a user with sudo access.
After cloning the repository, and changing directory to it, run:
./script/setup-system
On windows (in powershell, not WSL), run this instead:
./script/setup-system.ps1
Edit dotfiles
chezmoi edit --watch ~/.config/zsh/.zshrc
Apply dotfiles changes to the home directory
This step is implicitly done by the boostrap script. To run it manually, for example, after editing files inside the repository checkout, run this:
chezmoi apply
Update the dotfiles, including external files
chezmoi update -R
Update the dotfiles, external files, and home directory packages
./script/update
Manual Setup Steps
Manual Setup Steps for 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
Manual Setup Steps for 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
ssh-add
in powershell to add my key to the agent, if it exists -
Remove Edge, Store, Mail from the task bar pins.
What's Included
Dotfiles
Zsh Plugins
- fzf-tab: Replace zsh's default completion selection menu with fzf.
- nix-zsh-completions: ZSH Completions for Nix.
- powerlevel10k: A Zsh theme.
- zbell: Make Zsh print a bell when long-running commands finish.
- zsh-autosuggestions: Fish-like autosuggestions for zsh.
- zsh-bd: Jump back to a specific directory, without doing
cd ../../..
. - zsh-completions: Additional completion definitions for Zsh.
- zsh-git-escape-magic: zle tweak for git command line arguments.
- zsh-history-substring-search: ZSH port of Fish history search (up arrow).
- zsh-manydots-magic: zle tweak for emulating ...==../.. etc.
- zsh-nix-shell: Zsh plugin that lets you use zsh in nix-shell shells.
- zsh-syntax-highlighting: Fish shell like syntax highlighting for Zsh.
External Scripts included for non-Windows platforms
- bat-extras: Scripts that integrate bat with various command line tools.
- cht.sh: Command-line client for cheat.sh, the only cheat sheet you need.
Installed CLI Packages
-
curl: Command line tool and library for transferring data with URLs.
-
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.
-
gnupg: A complete and free implementation of the OpenPGP standard.
-
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.
-
fd: A simple, fast and user-friendly alternative to 'find'.
-
fzf: A command-line fuzzy finder.
-
ghq: Remote repository management made easy.
-
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.
-
ripgrep: A line-oriented search tool that recursively searches the current directory for a regex pattern.
-
sad: CLI search and replace | Space Age seD.
-
sd: Intuitive find & replace CLI (sed alternative).
-
shellcheck: A static analysis tool for shell scripts.
-
shfmt: Format shell programs.
-
tealdeer: Simplified, example based and community-driven man pages.
-
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.
CLI Packages on Linux and macOS
-
nix: Nix is a tool that takes a unique approach to package management and system configuration.
-
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
.
- On Windows, I have a powershell function which does this, and is aliased to
CLI Packages on Linux, macOS, and FreeBSD
-
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 "$@"' -
).
- On Windows, patchutils can be used via either WSL or MSYS2 (which can be installed via scoop and run as
-
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.
CLI Packages on Linux, macOS, and Windows
- sapling: A Scalable, User-Friendly Source Control System.
CLI Packages on 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.
CLI Packages on 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.
CLI Packages on 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.
CLI Packages on WSL2
- socat: Multipurpose relay for bidirectional data transfer. This is required for npiperelay.
CLI Packages on Windows
- bat-extras: Scripts that integrate bat with various command line tools.
- Build Tools for Visual Studio 2022: These Build Tools allow you to build Visual Studio projects from a command-line interface.
- cht.exe: cht.sh libcurl client for Windows.
- 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.
- posh-alias: A better alias for Powershell.
- PSFzf: A PowerShell wrapper around the fuzzy finder fzf.
- Recycle: Deletes the file or folder as if it had been done via File Explorer, or restores a deleted file from the recycle bin.
Installed GUI Software (MacOS & Windows Only)
GUI Software on Windows and macOS
- 1Password: A password manager developed by AgileBits.
- Discord: A VoIP and instant messaging social platform.
- IRCCloud
- Microsoft Teams
- Visual Studio Code
- Vivaldi
GUI Software on macOS (Pre-Sonoma Only)
- Aerial: A macOS screensaver that lets you play videos from Apple's tvOS screensaver.
GUI Software on macOS
- 1Password for Safari
- AdGuard for Safari
- Alfred
- AppCleaner
- Bear
- BlockBlock: Monitors common persistence locations and alerts whenever a persistent component is added.
- Brooklyn
- Calibre
- CleanMyDrive 2
- Declutter
- DevDocs for macOS: An unofficial DevDocs API Documentation viewer for macOS.
- GPG Suite: Tools to protect your emails and files.
- GoodLinks
- Hidden Bar
- Hush
- Itsycal for Mac: A tiny menu bar calendar.
- kitty: The fast, feature-rich, GPU based terminal emulator.
- LilyView
- LuLu: The free, open-source firewall that aims to block unknown outgoing connections.
- Magnet
- MusicHarbor
- PiPer
- PopClip
- Privacy Redirect
- Rectangle: Move and resize windows in macOS using keyboard shortcuts or snap areas.
- SessionRestore
- Shut Up
- Social Fixer for Facebook
- StopTheMadness
- SwiftDefaultApps: A preference pane will let you view and change default application associations.
- SyncThing
- Tampermonkey
- The Unarchiver
- Toolkit for YNAB
- Transmission Remote GUI: A feature rich cross platform Transmission BitTorrent client. Faster and has more functionality than the built-in web GUI.
- uBlacklist for Safari
- UnPlugged
- Userscripts
- Vinegar
- VLC
- WhatsYourSign: Add a menu item to Finder to display a file's cryptographic information.
- WiFi Explorer
- WiFi Signal
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
GUI Software on Windows
- 7-Zip
- AutoHotkey
- Ditto
- Gpg4win: Secure email and file encryption with GnuPG for Windows.
- HexChat
- Notepad++
- PowerShell
- PowerToys
- PuTTY
- QuickLook
- Rufus
- SnipDo: Select a text in any application and SnipDo pops up to help you
- SyncTrayzor
- Windows Terminal
Apps I install on an as-needed basis
As needed CLI Packages
- 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 asdogdns
, 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.
beets
For- 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.
As Needed CLI Packages for 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.
As Needed GUI Software
- 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 aspicard
, Microsoft Store, winget asMusicBrainz.Picard
, and scoop aspicard
. - 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 astor-browser-bundle-bin
, and winget asTorProject.TorBrowser
.
As Needed GUI Software for 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
.
As Needed GUI Software for Windows (All but BCU are available via winget)
- Autoruns (from Sysinternals)
- Balena Etcher
- Bulk Crap Uninstaller: Remove large amounts of unwanted applications quickly. This is an open source alternative to Revo Uninstaller. Available via scoop as
bulk-crap-uninstaller
. The project is currently looking for maintainers, so I may look for an alternative in the future. - Paint.NET
- Process Explorer (from Sysinternals)
- WinDirStat
- WinSCP
Implementation Notes
- Chezmoi is used to apply my dotfiles changes.
- A script is run by chezmoi which applies my nix home-manager configuration, if nix is installed.
- .config/git/config is not my main configuration, but is instead a small file which includes my main configuration. This allows for automatic git configuration changes such as vscode's change to credential.manager to be obeyed without it altering my stored git configuration. The downside to this is that these changes will not be highly visible. I may change this back, or keep the including file but track it so the changes are visible.
Reference
Chezmoi Usage
- Handle different file locations on different systems with the same contents
- Use completely different dotfiles on different machines
Supported Platforms
- Linux. Tested on Arch, Ubuntu, and Debian.
- MacOS.
- FreeBSD.
- Windows.
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.