blob: 5a871af13ab16685e4caa622ccf64356f307c303 (
plain)
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
|
{
config,
lib,
hosts,
...
}: let
cfg = config.collinux.user;
in {
users = {
mutableUsers = true; # system passwords stored mutably
users.${cfg.name} = {
isNormalUser = true;
description = cfg.name;
extraGroups = ["networkmanager" "pipewire" "disks" "input" "video" "dialout" "kvm"] ++ (lib.optional cfg.isAdmin "wheel");
};
};
services.userborn.enable = true;
# sudo
security = {
sudo.enable = false;
sudo-rs.enable = !cfg.useRun0;
run0.enableSudoAlias = cfg.useRun0;
};
time.timeZone = "America/Chicago";
programs.ssh = {
systemd-ssh-proxy.enable = false;
knownHosts = builtins.mapAttrs (_: data:
{
publicKey = data.host_pubkey;
}
// (lib.optionalAttrs (data ? hostnames) {
hostNames = data.hostnames;
}))
hosts;
};
hjem = {
clobberByDefault = true;
users."${cfg.name}" = {
enable = true;
directory = "/home/${cfg.name}";
user = cfg.name;
};
};
}
|