user factory
This commit is contained in:
28
modules/nix-tools/user.nix
Normal file
28
modules/nix-tools/user.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
# Lifted from:
|
||||
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/blob/69edacdb5a4a6ca71d649bb8eb62cf8c630c8627/modules/users/bob%20%5BNDn%5D/bob.nix#L8
|
||||
{ self, ... }:
|
||||
{
|
||||
config.flake.factory.user = username: isAdmin: {
|
||||
|
||||
nixos."${username}" = { lib, pkgs, ... }: {
|
||||
users.users."${username}" = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
extraGroups = lib.optionals isAdmin [
|
||||
"input"
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
home-manager.users."${username}" = {
|
||||
imports = [
|
||||
self.modules.homeManager."${username}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeManager."${username}" = {
|
||||
home.username = "${username}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user