user factory reworks
This commit is contained in:
+29
-24
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user