Co-Pilot
Updated a month ago

dotfiles

Cconnorads
0.0k
connorads/dotfiles
76
Agent Score

💡 Summary

This project manages dotfiles using git without symlinks, leveraging nix-darwin or home-manager for configuration.

🎯 Target Audience

Developers using macOS or LinuxSystem administrators managing configurationsOpen-source enthusiastsUsers looking for efficient dotfile managementTech-savvy individuals wanting to streamline their setup

🤖 AI Roast:Powerful, but the setup might scare off the impatient.

Security AnalysisMedium Risk

Risk: Medium. Review: shell/CLI command execution; outbound network access (SSRF, data egress); filesystem read/write scope and path traversal. Run with least privilege and audit before enabling in production.

dotfiles

Use git (and Sublime Merge) to manage dotfiles without using symlinks. Uses nix-darwin (macOS) or home-manager (Linux) and brew (macOS) to setup and install software, and mise to manage runtimes.

Usage

If you've already got your dotfiles setup you can use the following commands to manage your dotfiles.

Updating dotfiles

Track file

dotfiles add -f .somefile

Untrack file

dotfiles rm --cached .somefile

Managing system

macOS (nix-darwin)

Build and activate nix-darwin config. This will make changes to the system and update packages as per flake.nix

darwin-rebuild switch --flake ~/.config/nix # alias: drs

Update nix packages. This will update your non-homebrew packages and update flake.lock

nix flake update --flake ~/.config/nix # alias: nfu # You need to run build and activate after i.e. drs

Update brew packages

brew upgrade

Update mise packages

mise upgrade

Linux (home-manager)

Build and activate home-manager config. This will update packages as per flake.nix

home-manager switch --flake ~/.config/nix # alias: hms

Update nix packages. This will update your packages and update flake.lock

nix flake update --flake ~/.config/nix # alias: nfu # You need to run home-manager switch after i.e. hms

Update mise packages

mise upgrade

Setup

Setup (from this repo)

If you want to (fork and) clone this repo and use it for your own dotfiles, follow these steps.

  1. Clone repo

    DOTFILES_REPO=https://github.com/connorads/dotfiles/ DOTFILES_DIR=$HOME/git/dotfiles git clone --bare $DOTFILES_REPO $DOTFILES_DIR
  2. Change worktree to home directory

    cd $DOTFILES_DIR git config --unset core.bare git config core.worktree $HOME
  3. Put dotfiles from git into home directory (⚠️ this will overwrite existing dotfiles in home directory)

    cd $HOME git --git-dir=$DOTFILES_DIR/ checkout -f
  4. Setup nix, brew and install software (⚠️ skip the option to install Determinate Nix)

    macOS (nix-darwin):

    # Install Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" eval "$(/opt/homebrew/bin/brew shellenv)" # Install Nix curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh # Build and activate nix-darwin configuration nix run nix-darwin/master#darwin-rebuild -- switch --flake ~/.config/nix

    Linux (home-manager):

    # Install Nix curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install . ~/.nix-profile/etc/profile.d/nix.sh # Build and activate home-manager configuration nix run home-manager/master -- switch --flake ~/.config/nix
  5. You can now reload your shell and open Sublime Merge

    smerge $DOTFILES_DIR

Setup YubiKey for sudo

macOS let's you use Touch ID for sudo but dem keyboards be expensive. Maybe you gots a YubiKey, this is how you set it up so you can touch your YubiKey instead of typing your password. The sudo/pam config is taken care of in flake.nix.

mkdir ~/.config/Yubico pamu2fcfg > ~/.config/Yubico/u2f_keys

Add a second key if you like

pamu2fcfg -n >> ~/.config/Yubico/u2f_keys

Setup (from scratch)

Follow these steps to recreate the setup for this repo from scratch.

  1. Create repository to store dotfiles

    DOTFILES_DIR=$HOME/git/dotfiles git init --bare $DOTFILES_DIR
  2. Change worktree to home directory

    cd $DOTFILES_DIR git config --unset core.bare git config core.worktree $HOME
  3. Ignore all files except .gitignore (Sublime merge doesn't support status.showUntrackedFiles=no)

    cd $HOME echo "/*" >> .gitignore echo "!.gitignore" >> .gitignore
  4. Add alias to .zshrc

    echo "alias dotfiles='git --git-dir=$HOME/git/dotfiles/'" >> $HOME/.zshrc
  5. You can now start tracking files

Credit

Inspired by

5-Dim Analysis
Clarity8/10
Novelty6/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

Pros

  • Efficient management of dotfiles
  • No symlinks required
  • Integration with nix-darwin and home-manager
  • Supports both macOS and Linux

Cons

  • May require familiarity with git and command line
  • Potential for overwriting existing dotfiles
  • Limited to specific OS configurations
  • Setup can be complex for beginners

Related Skills

pytorch

S
toolCode Lib
92/ 100

“It's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.”

agno

S
toolCode Lib
90/ 100

“It promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.”

nuxt-skills

S
toolCo-Pilot
90/ 100

“It's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.”

Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.

Copyright belongs to the original author connorads.