40 lines
997 B
Nix
40 lines
997 B
Nix
{ lib, ... }:
|
|
let
|
|
userSubmodule = lib.types.submodule {
|
|
options = {
|
|
name = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = ''
|
|
full name
|
|
'';
|
|
};
|
|
email = lib.mkOption { type = lib.types.str; };
|
|
sshKeys = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
description = ''
|
|
SSH public keys
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
peopleSubmodule = lib.types.submodule {
|
|
options = {
|
|
users = lib.mkOption { type = lib.types.attrsOf userSubmodule; };
|
|
me = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = ''
|
|
The name of the user that represents me.
|
|
|
|
Admin user in all contexts.
|
|
|
|
Should be a key into the `users` attribute set.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
in {
|
|
# TODO: can we hack in an assertion that `me` is a key in `users`?
|
|
options = { people = lib.mkOption { type = peopleSubmodule; }; };
|
|
config = { people = import ./config.nix; };
|
|
}
|