|
11 | 11 | group = import ./group.nix;
|
12 | 12 | user = import ./user.nix;
|
13 | 13 |
|
14 |
| - toGID = v: { "${toString v.gid}" = v.name; }; |
15 |
| - toUID = v: { "${toString v.uid}" = v.name; }; |
| 14 | + toGID = n: v: { "${toString v.gid}" = n; }; |
| 15 | + toUID = n: v: { "${toString v.uid}" = n; }; |
16 | 16 |
|
17 | 17 | isCreated = list: name: elem name list;
|
18 | 18 | isDeleted = attrs: name: ! elem name (mapAttrsToList (n: v: v.name) attrs);
|
19 | 19 |
|
20 |
| - gids = mapAttrsToList (n: toGID) (filterAttrs (n: v: isCreated cfg.knownGroups v.name) cfg.groups); |
21 |
| - uids = mapAttrsToList (n: toUID) (filterAttrs (n: v: isCreated cfg.knownUsers v.name) cfg.users); |
| 20 | + gids = mapAttrsToList toGID (filterAttrs (n: v: isCreated cfg.knownGroups v.name) cfg.groups); |
| 21 | + uids = mapAttrsToList toUID (filterAttrs (n: v: isCreated cfg.knownUsers v.name) cfg.users); |
22 | 22 |
|
23 | 23 | createdGroups = mapAttrsToList (n: v: cfg.groups."${v}") cfg.gids;
|
24 | 24 | createdUsers = mapAttrsToList (n: v: cfg.users."${v}") cfg.uids;
|
|
112 | 112 | in
|
113 | 113 | !user.ignoreShellProgramCheck -> (s == shell || (shell == "bash" && s == "bash-interactive")) -> (config.programs.${shell}.enable == true);
|
114 | 114 | message = ''
|
115 |
| - users.users.${user.name}.shell is set to ${shell}, but |
| 115 | + users.users.${name}.shell is set to ${shell}, but |
116 | 116 | programs.${shell}.enable is not true. This will cause the ${shell}
|
117 | 117 | shell to lack the basic Nix directories in its PATH and might make
|
118 | 118 | logging in as that user impossible. You can fix it with:
|
119 | 119 | programs.${shell}.enable = true;
|
120 | 120 |
|
121 | 121 | If you know what you're doing and you are fine with the behavior,
|
122 |
| - set users.users.${user.name}.ignoreShellProgramCheck = true; |
| 122 | + set users.users.${name}.ignoreShellProgramCheck = true; |
123 | 123 | instead.
|
124 | 124 | '';
|
125 | 125 | }) [
|
|
331 | 331 | environment.systemPackages = systemShells;
|
332 | 332 |
|
333 | 333 | environment.etc = mapAttrs' (name: { packages, ... }: {
|
334 |
| - name = "profiles/per-user/${name}"; |
| 334 | + name = "profiles/per-user/${cfg.users.${name}.name}"; |
335 | 335 | value.source = pkgs.buildEnv {
|
336 | 336 | name = "user-environment";
|
337 | 337 | paths = packages;
|
|
0 commit comments