Allow overriding username

More specifically, this assists with the Steam Deck.
This commit is contained in:
Spotlight 2024-01-24 12:48:54 -06:00
parent 252fcc6f6f
commit a2c941ea44
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
3 changed files with 26 additions and 12 deletions

View file

@ -8,22 +8,26 @@ let
# Whether to configure various programs to leverage GPG.
gpg = specialArgs.gpg or false;
in
{
# It's standard convention that Darwin has the username
# "spot" - "spotlight" was reserved by the system at some point.
# "spot" - regretfully, "spotlight" is reserved by the system.
# (Sigh... the downsides of sharing a namesake.)
home.username =
nativeUsername =
if pkgs.stdenv.isDarwin then
"spot"
else
"spotlight";
username = specialArgs.username or nativeUsername;
in
{
home.username = username;
home.homeDirectory =
if pkgs.stdenv.isDarwin then
"/Users/spot"
"/Users/" + username
else
"/home/spotlight";
"/home/" + username;
# Git
programs.git = {