summaryrefslogtreecommitdiff
path: root/modules/root/normaluser.nix
blob: ec266c4e24577f947957f89b704f4db121870eb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ lib, config, userDetails, ... }: {
	options = {
		users.setPassword.enable = lib.mkEnableOption "set users password. requires hashed root password from sops";
	};

	config = {
		users.users.root = lib.mkIf config.users.setPassword.enable {
			hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
		};
		users.users.${userDetails.username} = {
			description = userDetails.fullname;
			isNormalUser = true;
			hashedPasswordFile = lib.mkIf config.users.setPassword.enable config.sops.secrets.hashed-root-password.path;
			extraGroups = [
				"i2c"
				"libvirtd"
				"nixbld"
				"video"
				"wheel"
			];
		};
	};
}