Skip to content

Latest commit

 

History

History
168 lines (122 loc) · 5.35 KB

README.md

File metadata and controls

168 lines (122 loc) · 5.35 KB

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: Nix

Note: Not tested, so leave a PR if it doesn't work

  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, activate Flox`:

# Activate Flox
flox activate
  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

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

There's no need to switch profiles anymore. It will simply detect the profile based on the home path.

Usage

First Time Setup (Not Using Flox)

  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

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