Validate username once in flake
Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{ config, pkgs, inputs, system, hostname, username, passwordHashPath, ... }:
|
||||
{ config, pkgs, inputs, system, hostname, username, usernameValid, passwordHashPath, ... }:
|
||||
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = builtins.match "^[a-z_][a-z0-9_]*$" username != null;
|
||||
message = "username must be a simple system user name without path separators.";
|
||||
assertion = usernameValid;
|
||||
message = "username must be a simple system user name and not reserved.";
|
||||
}
|
||||
];
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user