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,10 +19,14 @@
homeModules.marley = homeModules.marley =
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports =
let
myHomeMods = "${self}/modules/home";
in
[
inputs.rose-pine.homeManagerModules.rose-pine inputs.rose-pine.homeManagerModules.rose-pine
"${self}/modules/home/iconTheme.nix" "${myHomeMods}/iconTheme.nix"
"${self}/modules/home/shellAbbrs.nix" "${myHomeMods}/shellAbbrs.nix"
"${self}/home" "${self}/home"
]; ];
}; };
@ -32,16 +36,18 @@
{ pkgs, ... }: { pkgs, ... }:
let let
me = "marley"; me = "marley";
home = if pkgs.stdenv.isDarwin then "Users" else "home";
inherit (self.nixos-unified.lib) mkHomeConfiguration; inherit (self.nixos-unified.lib) mkHomeConfiguration;
in in
{ {
legacyPackages.homeConfigurations."${me}" = mkHomeConfiguration pkgs ( legacyPackages.homeConfigurations."${me}" = mkHomeConfiguration pkgs (
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ self.homeModules."${me}" ]; imports = [
home.username = me; "${self}/modules/home/me.nix"
home.homeDirectory = "/${home}/${me}"; self.homeModules."${me}"
];
me.name = me;
home.stateVersion = "24.05"; 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; targets.genericLinux.enable = lib.mkIf pkgs.stdenv.isLinux true;
home.language.base = "en_US.UTF-8"; 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}";
};
}