69 lines
1.4 KiB
Nix
69 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib;
|
|
{
|
|
options = {
|
|
me = rec {
|
|
name = mkOption {
|
|
type = types.str;
|
|
default = builtins.getEnv "HOME";
|
|
defaultText =
|
|
# nix
|
|
literalExpression ''
|
|
builtins.getEnv "HOME"
|
|
'';
|
|
description = ''
|
|
Your username, for use as your home folder and login name.
|
|
'';
|
|
};
|
|
|
|
username = mkOption {
|
|
type = types.str;
|
|
default = name;
|
|
defaultText = literalMD "{option}`home.me.name`";
|
|
description = ''
|
|
Your username, for external profiles.
|
|
'';
|
|
};
|
|
|
|
email = mkOption {
|
|
type = with types; nullOr str;
|
|
default = null;
|
|
description = ''
|
|
Your email.
|
|
'';
|
|
};
|
|
|
|
git.name = mkOption {
|
|
type = with types; nullOr str;
|
|
default = null;
|
|
description = ''
|
|
Your git committer name.
|
|
'';
|
|
};
|
|
|
|
git.email = mkOption {
|
|
type = with types; nullOr str;
|
|
default = email;
|
|
defaultText = literalMD "{option}`home.me.email`";
|
|
description = ''
|
|
Your git committer email.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config =
|
|
let
|
|
cfg = config.me;
|
|
homeDir = if pkgs.stdenv.isDarwin then "Users" else "home";
|
|
in
|
|
{
|
|
home.username = cfg.name;
|
|
home.homeDirectory = "/${homeDir}/${cfg.name}";
|
|
};
|
|
}
|