forked from DGNum/infrastructure
feat(shell): Add pre-commit hooks and reformat the repo
This commit is contained in:
parent
988c44d461
commit
5e3819c9b2
91 changed files with 3772 additions and 2282 deletions
|
@ -31,7 +31,13 @@
|
|||
# pris connaissance de la licence CeCILL, et que vous en avez accepté les
|
||||
# termes.
|
||||
|
||||
{ config, lib, meta, name, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
meta,
|
||||
name,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
|
@ -40,10 +46,13 @@ let
|
|||
mkIf
|
||||
mkOption
|
||||
|
||||
types;
|
||||
types
|
||||
;
|
||||
|
||||
nodeMeta = meta.nodes.${name};
|
||||
admins = meta.members.groups.root ++ nodeMeta.admins
|
||||
admins =
|
||||
meta.members.groups.root
|
||||
++ nodeMeta.admins
|
||||
++ (builtins.concatMap (g: meta.members.groups.${g}) nodeMeta.adminGroups);
|
||||
|
||||
cfg = config.dgn-access-control;
|
||||
|
@ -51,7 +60,9 @@ in
|
|||
|
||||
{
|
||||
options.dgn-access-control = {
|
||||
enable = mkEnableOption "DGNum access control." // { default = true; };
|
||||
enable = mkEnableOption "DGNum access control." // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
users = mkOption {
|
||||
type = with types; attrsOf (listOf str);
|
||||
|
@ -72,8 +83,8 @@ in
|
|||
# Admins have root access to the node
|
||||
dgn-access-control.users.root = mkDefault admins;
|
||||
|
||||
users.users = builtins.mapAttrs
|
||||
(u: members: { openssh.authorizedKeys.keys = lib.extra.getAllKeys members; })
|
||||
cfg.users;
|
||||
users.users =
|
||||
builtins.mapAttrs (_: members: { openssh.authorizedKeys.keys = lib.extra.getAllKeys members; })
|
||||
cfg.users;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue