Skip to content

alloydwhitlock/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

This repository contains Adam Whitlock's personal home-manager configuration for managing dotfiles and system configurations.

Package Management

This configuration uses Flox for package management rather than home-manager's package management capabilities. While home-manager handles dotfiles and program configurations, all package installation and updates are managed through Flox commands (flox install, flox update, etc.). This separation provides more direct control over package management and allows for easier package state management across different systems. Home-manager's package management is intentionally disabled in this setup - if you need to install a new package, use flox install package-name instead of adding it to home-manager's configuration.

I have added additional documentation for how to use Nix for installing home-manager. With that stated, nothing prevents you from using these configurations and Nix packages anyway you want.

Prerequisites

You either need to have a working Nix (Nix Packages) setup OR something that can manage the dependencies for Nix. I've provided a couple different options for management. Right now, I'm playing with Flox so the Flox version will work.

Option 1: Install Nix (Standard Setup)

  1. First, ensure you have Nix installed. If not, install it:
sh <(curl -L https://nixos.org/nix/install) --daemon
  1. Add the home-manager channel:
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
  1. Install home-manager:
nix-shell '' -A install
  1. Restart your shell or source your profile:
. $HOME/.nix-profile/etc/profile.d/nix.sh
  1. Verify the installation:
home-manager --version

Option 2: Install Flox (If You Use/Love Flox)

  1. Visit Flox Installation Guide and follow the installation instructions for your operating system.

  2. After installation, add Flox to your .bashrc:

# Enable Flox
eval $(flox activate)
  1. Restart your shell or source your .bashrc:
source ~/.bashrc
  1. Pulling Configuration via Floxhub (optional)

To use the Flox configuration from FloxHub, you can pull it directly using the following command:

flox pull alloydwhitlock/default
  1. Install Home Manager

With Flox installed, install home-manager using your default environment:

flox install home-manager

Configuration Structure

Here's the basic configuration structure, showing how it's setup. This may differ over time from the actual structure:

~/.config/home-manager/
├── home.nix                 # Main configuration entry point
└── profiles
    ├── default.nix          # Profile selection logic
    ├── default/             # Base profile (always loaded)
    │   ├── default.nix
    │   ├── packages.nix
    │   └── programs/
    │       ├── alacritty.nix
    │       ├── git.nix
    │       ├── tmux.nix
    │       └── vim.nix
    └── work/                # Work profile (adds to defaults unless specified)
        ├── default.nix
        ├── packages.nix
        └── programs/
            └── work-specific.nix

Profile Management

The configuration supports multiple profiles:

  • default: Base configuration used everywhere
  • work: Additional work-specific configurations, like Git config

Switching Profiles

To switch between profiles, use the HM_PROFILE environment variable before running home-manager:

For normal use:

HM_PROFILE=default home-manager switch

For work profile:

HM_PROFILE=work home-manager switch

To make this easier, you can add these as aliases to your shell configuration:

alias hm-default='HM_PROFILE=default home-manager switch'
alias hm-work='HM_PROFILE=work home-manager switch'

You can also set it permanently in your shell configuration or use environment detection:

# Add to your .bashrc or .zshrc
export HM_PROFILE="default"

# Check if home directory named/contains "adamwhitlock" or has .work file
if [[ "$HOME" == *"adamwhitlock"* ]] || [ -f "$HOME/.work" ]; then
    export HM_PROFILE="work"
fi

Profile Detection

To verify which profile is active:

echo $HM_PROFILE

Usage

First Time Setup

  1. Clone this repository
git clone <repository-url> ~/.config/dotfiles
  1. Create a symlink for home-manager
ln -s "$HOME/.config/dotfiles/.config/home-manager" "$HOME/.config/home-manager"
  1. Initial home-manager build & activation:
home-manager switch

Making Changes

  1. Edit configuration files as needed
  2. Apply changes:
home-manager switch

Adding New Programs

  1. Create a new configuration file in the appropriate profile directory
  2. Import it in the profile's default.nix
  3. Apply changes with home-manager switch

Troubleshooting

Common Issues

  1. Files already exist: Use backup flag
home-manager switch -b backup
  1. Check configuration:
home-manager build
  1. Show trace for errors:
home-manager switch --show-trace

Profile Detection

To verify which profile is active:

echo $HM_PROFILE

Notes

  • The default profile is always loaded
  • Work profile adds to (doesn't replace) the default profile
  • Configuration changes require running home-manager switch
  • Keep backups of important configurations before major changes

History

  • 2024.11.29 - Massive rewrite, removed all original configuration files, pushed into using Home Manager (Nix)
  • 2021.01.18 - Added .bashrc options for modernizing (Pop!_OS compatability), .vimrc cleanup. Removed unused Molokai theme, added Alacritty config
  • 2018.04.22 - Removed Vundle plugin support from dotfiles, added show/hide status for .tmux.conf, notes for using GNU Stow (thanks to Kyle Reid for the inspiration)
  • 2017.03.28 - Fixed .tmux.conf to support newer tmux directives for mouse & UDF
  • 2017.03.27 - Added Vundle plugin support, .vimrc improvements for Python development
  • 2016.11.04 - Added history options, .bash_profile, .gitconfig
  • 2016.09.08 - Modified Bash prompt to include relative directory path
  • 2016.08.10 - Added Molokai theme for Vim
  • 2016.07.17 - Creation and initial commit of basic dotfiles

About

Collection of various configuration files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages