-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.nix
More file actions
58 lines (52 loc) · 1.11 KB
/
users.nix
File metadata and controls
58 lines (52 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
lib,
pkgs,
username,
userDescription,
...
}:
{
# place password hash files in /home/${username}/secrets/ (including grub password)
users.defaultUserShell = pkgs.nushell;
# default user
users.users.${username} = {
isNormalUser = true;
description = userDescription;
extraGroups = [
"wheel"
"networkmanager"
"audio"
"video"
"cdrom"
"dialout"
"feedbackd"
];
hashedPasswordFile = "/home/${username}/secrets/${username}";
};
users.users.root.hashedPasswordFile = "/home/${username}/secrets/root";
# set default passwords for vm builds
virtualisation.vmVariant = {
users.users = {
root = {
password = "root";
hashedPasswordFile = lib.mkForce null;
};
${username} = {
password = username;
hashedPasswordFile = lib.mkForce null;
};
};
};
environment.etc."/security/pwquality.conf".text = ''
minlen=4
'';
# .cache tmpfs
fileSystems."home/${username}/.cache" = {
device = "none";
fsType = "tmpfs";
options = [
"size=4G"
"mode=777"
];
};
}