user factory

This commit is contained in:
John Lancaster
2026-03-10 23:12:09 -05:00
parent 5e62bcd97c
commit 24c6ac52a7
4 changed files with 59 additions and 30 deletions

View File

@@ -16,38 +16,39 @@ in
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
];
};
};
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect
flake.modules.nixos."${username}" = { pkgs, ... }: {
home-manager.users."${username}" = {
imports = [
inputs.self.modules.homeManager."${username}"
];
};
users.users."${username}" = {
isNormalUser = true;
shell = pkgs.zsh;
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
extraGroups = [ "docker "];
};
programs.zsh.enable = true;
};
modules = lib.mkMerge [
(inputs.self.factory.user username true)
{
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect
nixos."${username}" = { pkgs, ... }: {
home-manager.users."${username}" = {
imports = [
inputs.self.modules.homeManager."${username}"
];
};
users.users."${username}" = {
isNormalUser = true;
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
extraGroups = [ "docker" ];
};
};
flake.modules.homeManager."${username}" = {
home.username = "${username}";
home.homeDirectory = "/home/${username}";
home.stateVersion = "25.11";
xdg.enable = true;
homeManager."${username}" = {
home.stateVersion = "25.11";
xdg.enable = true;
programs.git.settings.user.name = "John Lancaster";
programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com";
programs.git.settings.user.name = "John Lancaster";
programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com";
imports = with inputs.self.modules.homeManager; [
base
# docker
# resticprofile
];
imports = with inputs.self.modules.homeManager; [
# base
# docker
# resticprofile
];
};
}
];
};
# This is the base homeConfiguration for the john user that will be used if no other