Correct username prefix check
Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
@@ -138,10 +138,10 @@ sudo nixos-rebuild boot --profile-name gaming --flake .#gaming
|
|||||||
|
|
||||||
Generate a password hash and save it to `/etc/nixos/secrets/<username>/password.hash` (replace `<username>` with your actual username):
|
Generate a password hash and save it to `/etc/nixos/secrets/<username>/password.hash` (replace `<username>` with your actual username):
|
||||||
```bash
|
```bash
|
||||||
sudo mkdir -p /etc/nixos/secrets/john
|
sudo mkdir -p /etc/nixos/secrets/<username>
|
||||||
sudo chmod 700 /etc/nixos/secrets/john
|
sudo chmod 700 /etc/nixos/secrets/<username>
|
||||||
mkpasswd -m sha-512 | sudo tee /etc/nixos/secrets/john/password.hash
|
mkpasswd -m sha-512 | sudo tee /etc/nixos/secrets/<username>/password.hash
|
||||||
sudo chmod 600 /etc/nixos/secrets/john/password.hash
|
sudo chmod 600 /etc/nixos/secrets/<username>/password.hash
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup MangoWC
|
### Setup MangoWC
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
usernameValid =
|
usernameValid =
|
||||||
builtins.match "^[a-z_][a-z0-9_]*$" username != null
|
builtins.match "^[a-z_][a-z0-9_]*$" username != null
|
||||||
&& builtins.match "^_+$" username == null
|
&& builtins.match "^_+$" username == null
|
||||||
&& builtins.match "^nix" username == null
|
&& builtins.match "^nix.*" username == null
|
||||||
&& username != "root";
|
&& username != "root";
|
||||||
hostConfig = (./hosts + "/${hostname}") + "/hardware-configuration.nix";
|
hostConfig = (./hosts + "/${hostname}") + "/hardware-configuration.nix";
|
||||||
passwordHashPath = "/etc/nixos/secrets/${username}/password.hash";
|
passwordHashPath = "/etc/nixos/secrets/${username}/password.hash";
|
||||||
|
|||||||
Reference in New Issue
Block a user