init
This commit is contained in:
45
modules/core/user.nix
Normal file
45
modules/core/user.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ pkgs
|
||||
, inputs
|
||||
, username
|
||||
, host
|
||||
, profile
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = false;
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit inputs username host profile; };
|
||||
users.${username} = {
|
||||
imports = [ ./../home ];
|
||||
home = {
|
||||
username = "${username}";
|
||||
homeDirectory = "/home/${username}";
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
};
|
||||
};
|
||||
users.mutableUsers = true;
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = "${gitUsername}";
|
||||
extraGroups = [
|
||||
"adbusers"
|
||||
"docker" #access to docker as non-root
|
||||
"libvirtd" #Virt manager/QEMU access
|
||||
"lp"
|
||||
"networkmanager"
|
||||
"scanner"
|
||||
"wheel" #subdo access
|
||||
"vboxusers" #Virtual Box
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
ignoreShellProgramCheck = true;
|
||||
};
|
||||
nix.settings.allowed-users = [ "${username}" ];
|
||||
}
|
||||
Reference in New Issue
Block a user