-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.nix
65 lines (64 loc) · 2.05 KB
/
users.nix
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
59
60
61
62
63
64
65
# List of users, their systems and information that is shared between them.
#
# NOTE: `foldUserl` and `foldHostl` describe the pattern that the flake expects
# for finding the absolute paths to the nixos and home-manager modules.
# To add your configuration files, start by adding your user information
# below in the `users` list of attribute sets, in the format defined, then
# reference the existing file tree under `./users` and add a directory
# named after the attribute set you've just created, `users.<your-name>`.
{
# Creates an attrset of users from a list of user data and information that is shared across their systems.
foldUserl = userl:
let
# Creates an attrset of hosts for a user from a list of host systems.
foldHostl = user:
let
hostl = user.hostl;
hosts' = { };
in
builtins.foldl'
(hosts': host:
hosts' // {
${host} = {
networking.hostName = host;
modulePath = ./users/${user.name}/systems/${host}/configuration.nix;
home-manager.modulePath = ./users/${user.name}/systems/${host}/home-manager;
};
})
hosts'
hostl;
users' = { };
in
builtins.foldl'
(users': user:
users' // {
${user.name} = {
name = user.name;
github = user.github;
description = user.description;
homeDirectory = "/home/${user.name}";
systems.hosts = foldHostl user;
};
})
users'
userl;
# Each attrset in the list represents a user, their host systems and any other extraneous data
# that may be shared across their host systems.
userl = [
{
name = "eureka";
github = {
username = "eureka-cpu";
profile = "github.com/eureka-cpu";
};
description = "Chris O'Brien";
hostl = [
"critter-tank"
"dev-one"
# "tensorbook"
# "pop-os"
# "yabai"
];
}
];
}