Skip to content

andrewbrey/dotfiles

Repository files navigation

dotfiles

  • Generate a new ssh key and give it a passphrase

    ssh-keygen -t ed25519 -C "34140052+andrewbrey@users.noreply.github.com"
  • Add the ssh key to GitHub: https://github.com/settings/keys

  • Clone dotfiles to local

    git clone git@github.com:andrewbrey/dotfiles.git ~/dotfiles
  • Run bootstrap

    ~/dotfiles/script/bootstrap
  • (Optional) Delete manually cloned dotfiles now that there is a chezmoi managed copy

    Use chezmoi to locate managed dotfiles, in particular with $(chezmoi source-path)

    rm -rf ~/dotfiles
  • Log out and back in to ensure changes to the login shell are enabled

  • Use the pam cli to install applications, e.g. a few apps at once

    pam install -a core-tools -a kitty -a fonts

    or a whole named group at once

    pam install -g devcontainer
  • Use the sam cli to apply settings

    sam apply

init script requirements

init/ scripts should be executable and have a shebang similar to:

#!/usr/bin/env -S deno run --allow-sys --allow-read --allow-net --allow-env --allow-run

Assumptions

  • Running from an interactive terminal (TTY)
  • chezmoi init happens last
  • All linux stuff happens on a debian derivative that has apt as the package manager
  • Only linux and mac are supported

TODO

  • Document usage of DOTFILES_PASSPHRASE within codespaces

  • Document that direct usage of chezmoi init shouldn't happen - instead, invoke the bootstrap script as there are environment vars used during chezmoi config creation that are set by the bootstrap process

  • Document and/or automate how to add new shell completions (as well as why they are encrypted in the first place)

  • Document that the .gitconfig can only easily be edited where it's not ignored because chezmoi edit file respects .chezmoiignore items (and won't decrypt the file to allow editing). Could do something like decrypt in source -> pipe to tmp -> make edits -> encrypt back to source but that is probably not worth it when you can just make edits in an environmtn where it's not ignored (i.e. not in a devcontainer)

  • Fix yarn-error.log caused by env vars

  • Document option to use:

    sh -c "$(curl -sSLf https://dotfiles.andrewbrey.com)"

    and how to do deploys to deno deploy using .web scripting

  • Document interaction with GH Keys (https://github.com/andrewbrey.keys) as a public key authority and how they are provided to rpi's

    • In general, just need to document the "on boot" shell start background tasks
  • Make init scripts idempotent so that if needed, the bootstrap script can be re-run on an already-configured system

  • Address TODO: refactor to os helpers comments by using $.onMac and $.onLinux helpers

  • Convert all apps to pull InstallerMeta at the top of the file instead at the end

  • Refactor so install logic can be shared by update logic if they are the same process

  • Update "single file binary" installers (skate, bat, etc) to use eget (as in charm installer)

  • Fix whatever causes tar to exit with a code of 2 when extracting (e.g. pam install flyctl)

    • Spent time reproducing the error using golang installer, and confirmed the issue has to do with my code, not tar, not dax, not gz, not the archive from golang download site...weird, but I guess...good?
  • Add amphetamine MacOS app to replace keepingyouawake since it is able to prevent system sleep on mac better while still allowing screen to sleep

  • Add oatmeal llm terminal client

  • Add freeze code screenshot tool

  • Address nodesource install script deprecation warning:

    SCRIPT DEPRECATION WARNING
    
    This script, located at https://deb.nodesource.com/setup_X, used to
    install Node.js is deprecated now and will eventually be made inactive.
    
    Please visit the NodeSource distributions Github and follow the
    instructions to migrate your repo.
    https://github.com/nodesource/distributions
    
    The NodeSource Node.js Linux distributions GitHub repository contains
    information about which versions of Node.js and which Linux distributions
    are supported and how to install it.
    https://github.com/nodesource/distributions
    
  • Add a script/teardown script next to script/bootstrap which can be used to remove sensitive config files and secrets in one command. Might be able to just use chezmoi purge (https://www.chezmoi.io/user-guide/advanced/migrate-away-from-chezmoi/). Should remove at least:

    • ~/.local/share/chezmoi (contains chezmoi source state)
    • ~/.config/chezmoi (contains chezmoi config files)
    • ~/.dots/.extra (prompt to read file before delete, may contain saveable info)
    • ~/.dots
    • ~/dotfiles (might not be present, depending on install steps followed)
    • ~/.ssh (confirmation prompt, also notify that ssh keys should be untrusted in GitHub)
    • ~/.zshrc
    • ~/.gitconfig