NixOS on ZFS: replace manual root password generation with bash variable
Signed-off-by: Maurice Zhou <jasper@apvc.uk>
This commit is contained in:
committed by
George Melikov
parent
41cdd28cf6
commit
7fe3e8ceb1
@@ -26,15 +26,14 @@ of declaratively configuring the system.
|
|||||||
|
|
||||||
#. Generate password hash::
|
#. Generate password hash::
|
||||||
|
|
||||||
mkpasswd -m SHA-512 -s
|
INST_ROOT_PASSWD=$(mkpasswd -m SHA-512 -s)
|
||||||
#output: $6$DeHnzc
|
|
||||||
|
|
||||||
#. Declare `initialHashedPassword
|
#. Declare `initialHashedPassword
|
||||||
<https://nixos.org/manual/nixos/stable/options.html#opt-users.users._name_.initialHashedPassword>`__
|
<https://nixos.org/manual/nixos/stable/options.html#opt-users.users._name_.initialHashedPassword>`__
|
||||||
for root user::
|
for root user::
|
||||||
|
|
||||||
tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <<-'EOF'
|
tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <<EOF
|
||||||
users.users.root.initialHashedPassword = "$6$DeHnzc";
|
users.users.root.initialHashedPassword = "${INST_ROOT_PASSWD}";
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
System installation
|
System installation
|
||||||
|
|||||||
Reference in New Issue
Block a user