Tighten path/docs clarity
Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
10
README.md
10
README.md
@@ -136,12 +136,12 @@ sudo nixos-rebuild boot --profile-name gaming --flake .#gaming
|
|||||||
|
|
||||||
### Change Password
|
### Change Password
|
||||||
|
|
||||||
Generate a password hash and save it to `/etc/nixos/secrets/<username>/password.hash` (required before applying the config):
|
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/<username>
|
sudo mkdir -p /etc/nixos/secrets/john
|
||||||
sudo chmod 700 /etc/nixos/secrets/<username>
|
sudo chmod 700 /etc/nixos/secrets/john
|
||||||
mkpasswd -m sha-512 | sudo tee /etc/nixos/secrets/<username>/password.hash
|
mkpasswd -m sha-512 | sudo tee /etc/nixos/secrets/john/password.hash
|
||||||
sudo chmod 600 /etc/nixos/secrets/<username>/password.hash
|
sudo chmod 600 /etc/nixos/secrets/john/password.hash
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup MangoWC
|
### Setup MangoWC
|
||||||
|
|||||||
@@ -45,8 +45,8 @@
|
|||||||
&& 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 = assert usernameValid; "/etc/nixos/secrets/${username}/password.hash";
|
passwordHashPath = "/etc/nixos/secrets/${username}/password.hash";
|
||||||
specialArgs = { inherit inputs system hostname username usernameValid passwordHashPath; };
|
specialArgs = { inherit inputs system hostname username usernameValid passwordHashPath; };
|
||||||
|
|
||||||
# Verify mango flake exports the expected module
|
# Verify mango flake exports the expected module
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = usernameValid;
|
assertion = usernameValid;
|
||||||
message = "username must be a simple system user name and not reserved.";
|
message = "username must start with a-z or _, contain only lowercase letters, digits, and underscores, and must not be root or start with nix.";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user