A bunch of junk you probably don’t want to waste time with. Using Nix + Flakes
Bootstrap is still WIP. Don’t actually try to use this.
- Install Nix:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install. Don’t @ me. - Start a dev shell:
nix develop github:webframp/dotfiles - Or if cloned locally, dev shell:
nix develop . - Run
nix run . switch -- --flake .#hostnameand watch it do stuff.- Optionally use
nix --debug run . switch -- --flake .to get verbose output. - Non-NixOS, home-manager only configs use
home-manager switch --flake .#user@hostname
- Optionally use
Fix for “Unable to determine time zone: No such file or directory (os error 2)”
sudo timedatectl set-timezone America/New_York
sudo hwclock -sThe Windows Subsystem for Linux kernel can be manually updated with ‘wsl –update’, but automatic updates cannot occur due to your system settings. To receive automatic kernel updates, please enable the Windows Update setting: ‘Receive updates for other Microsoft products when you update Windows’. For more information please visit https://aka.ms/wsl2kernel.
Install
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iexPackages
scoop bucket add extras
scoop bucket add nerd-fonts
scoop install 7zip audacity aws bat cpu-z dark discord dotnet-sdk firefox fzf git git-credential-manager go helm Inconsolata-NF-Mono Iosevka-NF-Mono jq less neofetch neovim powertoys quicklook ripgrep signal slack spotify starship steam teamviewer terraform vcredist2022 vscode win32yank zoom zoxideInstall powershell + profile
winget install --id Microsoft.Powershell --source winget # restart terminal code $PROFILE
???
???
Use ed25519 already.
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "use@machine: detail"TODO Setup doom
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
~/.config/emacs/bin/doom installClone org repo into ~/org
After GPG setup, clone password store repo from backup drive, run:
chown -R $(whoami) ~/.gnupg/
find ~/.gnupg -type f -exec chmod 600 {} \;
find ~/.gnupg -type d -exec chmod 700 {} \;Super minimal .bash_profile that most uses nixos defaults
#!/usr/bin/env bash
#
# ensure defaults are loaded
if test -f /etc/bashrc; then
. /etc/bashrc
fi
# Pass
alias qp='pass -c "$(find -L "$HOME/.password-store" \( -name .git\* -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${HOME}/.password-store/\{0,1\}##" -e 's#\.gpg##'|sort|fzf)"'
alias qpo='pass otp -c "$(find -L "$HOME/.password-store" \( -name .git\* -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${HOME}/.password-store/\{0,1\}##" -e 's#\.gpg##'|sort|fzf)"'
alias qpe='EDITOR=vim pass edit "$(find -L "$HOME/.password-store" \( -name .git\* -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${HOME}/.password-store/\{0,1\}##" -e 's#\.gpg##'|sort|fzf)"'
The 24bit color config depends on a custom terminfo file in this repo. Still need to find a way to build this for systemwide config with nix.
Unclear if this is useful yet: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/terminfo.nix
For now this is handled per user automatically using home-manager in home/sme/global/default.nix with:
home.file.".xterm-24bit.terminfo" = {
source = ./includes/xterm-24bit.terminfo;
onChange = "tic -x -o ~/.terminfo ~/.xterm-24bit.terminfo";
};/usr/bin/tic -x -o ~/.terminfo xterm-24bit.terminfo
export TERM=xterm-24bit
alias ssh="TERM=xterm-256color ssh" # maybe neededAdd to tmux config
set -g default-terminal "xterm-24bit"
set -g terminal-overrides ',xterm-24bit:Tc'Also make sure locale vars are set correctly
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8| Host | Platform | Integration | Config File |
|---|---|---|---|
| bluestreak | macOS arm64 | home-manager standalone | home/sme/bluestreak.nix |
| galvatron-wsl | NixOS x86_64 | home-manager as NixOS module | home/sme/galvatron-wsl.nix |
| ubuntu-wsl | Ubuntu x86_64 | home-manager standalone | home/sme/ubuntu-wsl.nix |
| generic | Linux x86_64 | home-manager standalone | home/sme/generic.nix |
Shared configuration lives in modules/home-manager/. Host-specific files import these modules.
zsh.nix- Shell configuration, plugins, aliases, optimizations
These intentionally differ per host and should remain in host-specific files:
- **SSH keys** - Different key IDs per machine identity
- **GPG configuration** - Per-host signing keys and agent settings
- **Keychain** - References host-specific SSH/GPG keys
- **Git signing** - Uses host-specific GPG key
- **Platform-specific packages** - macOS vs Linux binaries
Currently used by ubuntu-wsl, galvatron-wsl, and generic as a shared base. NOT imported by bluestreak (parallel config).
Goal: Either eliminate global by extracting all shared configs into modules, or make global truly universal (importable by all hosts including bluestreak).
The zsh configuration is managed via a custom home-manager module at modules/home-manager/zsh.nix.
Home-manager’s zsh module uses lib.mkOrder to control where content appears in the generated .zshrc.
Lower priority numbers appear earlier in the file. Key priorities:
| Priority | Section |
|---|---|
| 100 | p10k instant prompt |
| 400 | zprof (profiling) |
| 600-700 | paths, fpath, NIX_PROFILES |
| 900 | plugins |
| 950 | compinit |
| 1000+ | user content |
For p10k’s instant prompt to work, it must be at the very top of .zshrc (before any output).
We use lib.mkOrder 100 to ensure this.
See: nix-community/home-manager#6479
The module includes optimizations for faster shell startup:
- Powerlevel10k instant prompt (cached prompt display)
- Daily compinit caching (only regenerates completions once per 24h)
- Background zcompdump compilation on login
Measure startup time with: make zsh-bench
- https://zero-to-nix.com/
- https://github.com/Misterio77/nix-starter-configs
- https://github.com/nix-community/NixOS-WSL
- https://www.chrisportela.com/posts/home-manager-flake/
- https://gvolpe.com/blog/nix-flakes/
- https://nix-community.github.io/home-manager/options.html
- https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54
- https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
- https://github.com/syl20bnr/spacemacs/wiki/Terminal
- a bug I also hit
Some useful cleanup commands
nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 30d
nix-collect-garbage