Compare commits

...

2 commits

Author SHA1 Message Date
e63b6d8914
feat(home): Use me 2024-11-13 21:12:15 -08:00
e9f3156e1f
feat(modules): Write me module 2024-11-13 21:12:09 -08:00
3 changed files with 90 additions and 10 deletions

View file

@ -19,12 +19,16 @@
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}/shellAbbrs.nix"
"${self}/home"
];
};
};
@ -32,16 +36,18 @@
{ pkgs, ... }:
let
me = "marley";
home = if pkgs.stdenv.isDarwin then "Users" else "home";
inherit (self.nixos-unified.lib) mkHomeConfiguration;
in
{
legacyPackages.homeConfigurations."${me}" = mkHomeConfiguration pkgs (
{ pkgs, ... }:
{
imports = [ self.homeModules."${me}" ];
home.username = me;
home.homeDirectory = "/${home}/${me}";
imports = [
"${self}/modules/home/me.nix"
self.homeModules."${me}"
];
me.name = me;
home.stateVersion = "24.05";
}
);

View file

@ -4,6 +4,11 @@
...
}:
{
me = {
username = "punkfairie";
email = "marley@punkfairie.net";
};
targets.genericLinux.enable = lib.mkIf pkgs.stdenv.isLinux true;
home.language.base = "en_US.UTF-8";

69
modules/home/me.nix Normal file
View file

@ -0,0 +1,69 @@
{
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}";
};
}