/dotfiles

ermahgerd, some dotfiles

Primary LanguageShell

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

References