feat(nixos): Add marleyos.my module

This commit is contained in:
punkfairie 2025-01-06 18:52:09 -08:00
parent e65fde6ead
commit 404f4a9294
No known key found for this signature in database
GPG key ID: B3C5488E9A1A7CA6
2 changed files with 62 additions and 3 deletions

View file

@ -1,10 +1,21 @@
{config, ...}: {
_: let
my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
in {
marleyos.my = {
inherit (my) name username fullName email;
};
users = {
mutableUsers = false;
users.users."${config.marleyos.my.name}" = {
users.users."${my.name}" = {
isNormalUser = true;
description = config.marleyos.my.fullName;
description = my.fullName;
extraGroups = ["networkmanager" "wheel"];
hashedPassword = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
};

View file

@ -0,0 +1,48 @@
{
lib,
config,
...
}: let
inherit
(lib)
mkOption
types
;
in {
options.marleyos.my = rec {
name = mkOption {
type = with types; str;
default = config.snowfallorg.user.name or "marley";
description = "Your username, for use as your login name.";
};
username = mkOption {
type = with types; str;
default = name;
description = "Your username, for external profiles.";
};
fullName = mkOption {
type = with types; str;
default = name;
description = "Your full name, for display purposes.";
};
email = mkOption {
type = with types; nullOr str;
default = null;
description = "Your email";
};
};
config = let
cfg = config.marleyos.my;
in {
assertions = [
{
assertion = cfg.name != null;
message = "marleyos.my.name must be set.";
}
];
};
}