user factory reworks

This commit is contained in:
John Lancaster
2026-03-29 15:03:26 -05:00
parent 1991766a5e
commit 6d1cf5aa80
6 changed files with 56 additions and 52 deletions
+29 -24
View File
@@ -1,4 +1,4 @@
{ inputs, ... }:
{ self, inputs, lib, ... }:
let
username = "john";
in
@@ -16,28 +16,33 @@ in
];
};
flake.modules.nixos."${username}" = {
imports = [
inputs.home-manager.nixosModules.home-manager
(inputs.self.factory.user username true).nixos."${username}"
];
users.users."${username}" = {
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
extraGroups = [ "docker" ];
};
};
flake.modules = lib.mkMerge [
(self.factory.user {
username = username;
isAdmin = true;
})
{
nixos."${username}" = {
imports = [
inputs.home-manager.nixosModules.home-manager
];
users.users."${username}" = {
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
};
};
flake.modules.homeManager."${username}" = with inputs.self.meta.users."${username}"; {
home.stateVersion = "25.11";
xdg.enable = true;
programs.git.settings.user.name = name;
programs.git.settings.user.email = email;
imports = with inputs.self.modules.homeManager; [
ssh
shell-tools
git
];
};
# This module will be imported by the user factory
homeManager."${username}" = with inputs.self.meta.users."${username}"; {
home.stateVersion = "25.11";
xdg.enable = true;
programs.git.settings.user.name = name;
programs.git.settings.user.email = email;
imports = with inputs.self.modules.homeManager; [
ssh
shell-tools
git
];
};
}
];
}