feat: added machanism for not allowing users to sign up with forbidden/restricted usernames.

Names will be added to the nixos config.

Closes #23
This commit is contained in:
silver 2023-09-16 14:56:16 +01:00
parent 35952a2030
commit dadaf73c78
3 changed files with 26 additions and 4 deletions

View file

@ -55,10 +55,11 @@
SSH_ROOT = "skynet_old";
# special categories of users
USERS_ADMIN = lib.strings.concatStringsSep "," cfg.users.admin;
USERS_COMMITTEE = lib.strings.concatStringsSep "," cfg.users.committee;
USERS_LIFETIME = lib.strings.concatStringsSep "," cfg.users.lifetime;
USERS_BANNED = lib.strings.concatStringsSep "," cfg.users.banned;
USERS_ADMIN = lib.strings.concatStringsSep "," cfg.users.admin;
USERS_COMMITTEE = lib.strings.concatStringsSep "," cfg.users.committee;
USERS_LIFETIME = lib.strings.concatStringsSep "," cfg.users.lifetime;
USERS_BANNED = lib.strings.concatStringsSep "," cfg.users.banned;
USERS_RESTRICTED = lib.strings.concatStringsSep "," cfg.users.restricted;
};
service_name = script: lib.strings.sanitizeDerivationName("${cfg.user}@${script}");
@ -146,6 +147,11 @@
default = [];
description = "array of banned users";
};
restricted = mkOption rec {
type = types.listOf types.str;
default = [];
description = "array of restricted user accounts";
};
};
host_port = mkOption rec {