Skip to content

webframp/dotfiles

Repository files navigation

Dotfiles

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.

Setup

  1. Install Nix: curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install. Don’t @ me.
  2. Start a dev shell: nix develop github:webframp/dotfiles
  3. Or if cloned locally, dev shell: nix develop .
  4. Run nix run . switch -- --flake .#hostname and 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

Notes

WSL

Fix for “Unable to determine time zone: No such file or directory (os error 2)”

sudo timedatectl set-timezone America/New_York
sudo hwclock -s

The 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.

Windows pre-reqs: scoop

Install

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex

Packages

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 zoxide

Install powershell + profile

winget install --id Microsoft.Powershell --source winget
# restart terminal
code $PROFILE

macOS

???

Ubuntu

???

SSH Keygen

Use ed25519 already.

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "use@machine: detail"

Emacs

TODO Setup doom

git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
~/.config/emacs/bin/doom install

Org docs

Clone org repo into ~/org

Password Store

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)"'

Terminal and 24bit terminfo

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";
};

Manual setup

/usr/bin/tic -x -o ~/.terminfo xterm-24bit.terminfo
export TERM=xterm-24bit
alias ssh="TERM=xterm-256color ssh" # maybe needed

Add 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

Home-Manager Architecture

Host Configurations

HostPlatformIntegrationConfig File
bluestreakmacOS arm64home-manager standalonehome/sme/bluestreak.nix
galvatron-wslNixOS x86_64home-manager as NixOS modulehome/sme/galvatron-wsl.nix
ubuntu-wslUbuntu x86_64home-manager standalonehome/sme/ubuntu-wsl.nix
genericLinux x86_64home-manager standalonehome/sme/generic.nix

Module Strategy

Shared configuration lives in modules/home-manager/. Host-specific files import these modules.

Shared Modules (universal)

  • zsh.nix - Shell configuration, plugins, aliases, optimizations

Per-Host Configuration (NOT extractable)

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

Legacy: home/sme/global/

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).

Zsh Configuration

The zsh configuration is managed via a custom home-manager module at modules/home-manager/zsh.nix.

Content Ordering

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:

PrioritySection
100p10k instant prompt
400zprof (profiling)
600-700paths, fpath, NIX_PROFILES
900plugins
950compinit
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

Startup Optimization

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

References

Nix cleanup

Some useful cleanup commands

nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 30d
nix-collect-garbage

About

ermahgerd, some dotfiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •