> mthadley_

Mistyping My Own Name

Yesterday I was setting up a new computer computer for work. I use Nix to manage all of the configuration for my development environment so one of the steps is to run a script to bootstrap everything. It was all going great until I encountered an error:

Cannot find home folder: /Users/michale.hadley

Cue dramatic zoom on michale.hadley. Turns out during the initial setup I had, well, mistyped my own name.

What am I supposed to do now? I’ve never had to change a username on MacOS before and it doesn’t seem trivial. What might break? Should I nuke everything and start from scratch? Is the more pragmatic thing to just become Michale Hadley from now on? Do I immortalize this mistake forever in my Nix configuration?.

After a little frustration, turns out there’s a way out of this:

  1. You can’t directly edit your own username, at least in the MacOS settings GUI. So first create a new admin user and log in as them.
  2. Now in the Settings the username field is editable. So change that.
  3. Don’t be like me and immediately try to log in as the original user; MacOS will create a new home folder using the new name and then hang on the sign-in screen. Instead, rename the home folder in Finder, and then select it as the user’s home folder in the GUI.

So in the end I managed to correct my mistake. Initially Nix complained about not finding the old, typo-ed home folder, but that was fixed by deleting a .nix-profile symlink.

I’m still a little spooked about what gremlins may be hiding inside of a user account who had at one time had their username changed in a very janky feeling way. I guess I’ll find out.