mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
lib originates from Max Co-authored-by: Maximilan Marx <maximilian.marx@tu-dresden.de>
20 lines
464 B
Nix
20 lines
464 B
Nix
final: prev:
|
|
|
|
{
|
|
withConfig = config:
|
|
|
|
let
|
|
cfg = config.elss.users;
|
|
mapAccount = f: login: prev.nameValuePair login (f login);
|
|
mapList = f: lst: builtins.listToAttrs (map (mapAccount f) lst);
|
|
in
|
|
rec {
|
|
mapUsers = f: mapList f cfg.users;
|
|
mapAdmins = f: mapList f cfg.admins;
|
|
mapAllUsers = f: (mapUsers f) // (mapAdmins f);
|
|
mapAllUsersAndRoot = f: (mapAllUsers f) // {
|
|
root = f "root";
|
|
};
|
|
};
|
|
}
|