From dd3ac891d1f6aa4f7e869d49f2720395e57ae4e0 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Wed, 13 Nov 2024 21:00:00 -0800 Subject: [PATCH] feat(modules): Write home.me module --- flake.nix | 17 +++++++++----- modules/home/me.nix | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 modules/home/me.nix diff --git a/flake.nix b/flake.nix index 0646431..bdfb23b 100644 --- a/flake.nix +++ b/flake.nix @@ -19,12 +19,17 @@ homeModules.marley = { pkgs, ... }: { - imports = [ - inputs.rose-pine.homeManagerModules.rose-pine - "${self}/modules/home/iconTheme.nix" - "${self}/modules/home/shellAbbrs.nix" - "${self}/home" - ]; + imports = + let + myHomeMods = "${self}/modules/home"; + in + [ + inputs.rose-pine.homeManagerModules.rose-pine + "${myHomeMods}/iconTheme.nix" + "${myHomeMods}/me.nix" + "${myHomeMods}/shellAbbrs.nix" + "${self}/home" + ]; }; }; diff --git a/modules/home/me.nix b/modules/home/me.nix new file mode 100644 index 0000000..c7ef254 --- /dev/null +++ b/modules/home/me.nix @@ -0,0 +1,56 @@ +{ lib, ... }: +with lib; +{ + options = { + home = { + 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. + ''; + }; + }; + }; + }; +}